[CIR] Run callconv lowering in the tests that opted out of it (#216396)
48 CIR tests carried `-fno-clangir-call-conv-lowering` with a TODO to
drop it once the pass handled vector types, the long double wrapper,
f16, and f128. The classifier takes all of those now, so the opt-out and
its TODO go and the tests exercise the pass.
No CHECK line moves, so the IR these tests already pinned is what the
pass produces.
Assisted-by: Cursor / claude-opus-5
[SelectionDAG] SimplifySetCC - Improve shifted range checks with add offsets (#207955)
SelectionDAG currently shrinks large unsigned compare immediates by
shifting the compare operand as a whole. For top-bit range checks that
have been canonicalized to `icmp ult (add x, C), Width`, this can
preserve the pre-shift add and lead to extra masks, zero-extends, or
large immediates.
When the add offset and range width are aligned to the selected shift
and the original unsigned range does not wrap, move the offset after the
shift instead. This lets cases such as checking whether `x >> 48` is in
`[10, 20)` lower to shift/add/cmp.
Fixes #172674
[SLP]Recalculate copyable-element deps after tree reordering
Reordering permutes the operand columns of the entries and may move an
operand between copyable-covered and plain edges, making the computed
dependency counts stale and tripping the unscheduled-deps assertion.
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/216410
[CIR] Test bit-field access units split by register size
A span of bit-fields wider than one register splits into two access units, each
marked on its own. Nothing covered that path: every bit-field in these tests is
24 bits or narrower, and the splits already covered come from a zero-length
bit-field instead.
Two of the three cases are worth having for a reason beyond coverage. When a
record carries both a data unit and an empty one it is not ABI-empty either way,
so the differential assert cannot see a wrong mark on an individual unit, and
these checks are the only thing that can.
Assisted-by: Cursor / claude-opus-5
[clang][WebAssembly] Remove `OPT_no_pthread` handling (#216378)
`-no-pthread` was originally added to Clang in 425b1a5106def (D11087)
simply to prevent "unknown argument" errors when building winpthreads in
mingw-w64.
It was subsequently used in `WebAssembly.cpp` when thread options were
made consistent in 9d5a089bf544e (D57874) via `Args.hasFlag`.
No other Clang toolchains handle `OPT_no_pthread` (they all use
`Args.hasArg(options::OPT_pthread)`), and `-pthread` is not typically
treated as a negatable boolean option in GCC/Clang drivers.
Align WebAssembly with all other Clang toolchains by removing the
`OPT_no_pthread` check.
[analyzer] Only underline the exact parameter that is bound to the return value in UseAfterLifetimeEnd (#215651)
Currently the `UseAfterLifetimeEnd` checker highlights always the first
argument that is annotated with the `[[clang::lifetimebound]]`
annotation. Like:
```text
temp.cpp:5:31: note: Value's lifetime bound to the lifetime of 'y' here
4 | int x = 1, y = 2;
| ~~~~~~~~~~~~~~~~
5 | return multi_param_test_ref(x, y);
| ^
```
As seen even when checker correctly notes that the value's lifetime is
bound to the lifetime of the `y` parameter, it incorrectly highlights x
since that is the first annotated parameter. In order to fix this I have
added a logic which checks which annotated parameter's region is bound
to the return's region and do the highlight based on that.
[16 lines not shown]
[HLSL][longvec][Tablegen] Use templates to define Vector api's larger than 4 (#216143)
resolves #216139
resolves #216140
This change adds a templatized vector emitter to TableGen's HLSLEmitter.
We add tests for the tablegen and confirm we did it right by
implementing the abs api.
Assisted by GPT-5.6 sol via co-pilot
[CIR] Address more reviewer feedback
Remove droppedFieldHoldingData. The differential asserts allow for an error
having already been reported instead, which covers any NYI in record lowering
rather than just the one.
Mark a bit-field access unit by promoting its storage member when a named
occupant is emitted, rather than pre-scanning the unit first. Both bit-field
paths now do it the same way, and the unit's fields are walked once.
Rename runStorageIdx to storageIdx.
Assisted-by: Cursor / claude-opus-5
[DWARFLinker] Constrain a function's high_pc to its own symbol (#215952)
Mach-O objects built with .subsections_via_symbols make every symbol an
independently placeable atom, and the linker packs atoms without
preserving the spacing they had in the object file.
I have an example where the compiler describes such a subprogram as
extending past its own atom. While it's debatable whether that's a good
idea, it's not invalid in the object file. However, once linked, it is
invalid.
We can make dsymutil resilient against this by looking at the size of
the symbol in the debug map and adjusting the end_pc. I'm doing so
conservatively so that only a collision is repaired. Already
overlapping/invalid ranges remain untouched.
rdar://184768778
[LV] Simplify the latch branch before rewriting ALM for a scalar VF (#216257)
Run simplifyBranchConditionForVFAndUF before replaceMaskWithCompare
before, so the simplification triggers before replaceMaskWithCompare
writes the plan.
PR: https://github.com/llvm/llvm-project/pull/216257
[lldb][CMake] Give the staged lldb-defines.h a build rule (#216394)
a05b232076ed dropped lldb-defines.h from the header staging loop so that
the source header is never copied, leaving the staged copy to be
produced by a POST_BUILD command on liblldb-header-staging. Ninja cannot
see files produced that way, and LLDBRPCHeaders.cmake depends on the
staged path directly, so a clean build with LLDB_BUILD_LLDBRPC enabled
fails to even load the graph:
ninja: error: 'include/lldb/lldb-defines.h', needed by
'tools/lldb-rpc/DerivedHeaders/lldb-rpc-defines.h', missing and no
known rule to make it
Dropping the header from the loop also removed it from
lldb_staged_headers and from LLDB.framework/Headers, even though
SBDefines.h includes it.
Stage the header through version-header-fix.py from inside the loop
instead. The script reads the source header and writes a fresh staged
[3 lines not shown]
[RISCV][NFC] add `_Complex {integer}` ABI tests (#216386)
based on https://github.com/llvm/llvm-project/pull/215222, RISCV has the
same bug.
The fix is basically identical, I'll put up a PR once this merges.
[MLIR][NVVM] Spell strict assembly properties directly
NVVM strict property assembly currently uses prop-dict for many ops. Some
formats already bind every inherent field, and a few small groups can spell
their inherent attributes more naturally in the assembly syntax.
Spell the transcendental ftz flag, redux abs/nan flags, cluster aligned flag,
and small fence attributes directly. Drop prop-dict from formats whose
inherent fields are fully covered by the declarative format.
Adapt test coverage added since the original patch to the same strict
property spelling.
Assisted-by: Codex
[MLIR][NVVM] Enable strict property assembly format
Enable strict property assembly format mode for the NVVM dialect and update
custom assembly formats to expose property dictionaries explicitly.
Refresh NVVM tests so inherent operation properties are printed and parsed
through the property dictionary while non-property attributes remain in the
attribute dictionary.
Assisted-by: Codex
[ProfileData] Remove toCompress and setToCompress from ProfileSymbolList (NFC) (#216236)
This patch removes toCompress, setToCompress, and ToCompress in
ProfileSymbolList. Nobody calls setToCompress, so ToCompress is
always false.
[NFC] Remove obsolete typeids.test after fa23198d685b (#216379)
fa23198d685b replaced llvm::Any with IRUnitRef in
PassInstrumentation. IRUnitRef uses an enum discriminator instead of
address-based TypeId, so the visibility guard this test enforced no
longer applies.
[MLIR][SPIRV] Enable strict property assembly format (#196282)
Enable strict property assembly format mode for SPIR-V and add property
dictionaries to declarative formats that still carry inherent attributes
outside explicit operands or clauses.
Refresh ARM graph and TOSA tests so GraphConstant uses prop-dict
spelling for its inherent constant identifier.
Assisted-by: Codex
[MLIR][SPIRV] Enable strict property assembly format
Enable strict property assembly format mode for SPIR-V and add property
dictionaries to declarative formats that still carry inherent attributes outside
explicit operands or clauses.
Refresh ARM graph and TOSA tests so GraphConstant uses prop-dict spelling for
its inherent constant identifier.
Assisted-by: Codex