[clang][TableGen] suppress macro emission when trait spelling is empty (#246180)
Trait definitions in BuiltinTraits.td can have an empty associated
`Spelling`. This makes them internal traits that do not map to a builtin
recognized by the parser. This is still useful, since it allows us to
map a standard library spelling (such as
`std::is_trivially_copy_constructible`) to an internal-use trait and
reuse existing machinery for more detailed diagnostics.
Currently we only have one such trait `IsDeducible`. All of the current
uses of the macros generated from BuiltinTraits.td define the
`TYPE_TRAIT*` macros roughly like this
```cpp
#define TYPE_TRAIT_1(Spelling, Name, Key) \
case tok::kw_##Spelling: \
/* ... */
#define TYPE_TRAIT_2(Spelling, Name, Key) \
case tok::kw_##Spelling: \
/* ... */
[12 lines not shown]
[Clang][NFC] Add the list of C++ papers approved by WG21 at the Búzios 2026-11 meeting (#246574)
This adds the CWG motions approved by WG21 at the Búzios 2026-11
meeting, except for wording-only papers where no implementation is
needed.
Some papers apply to C++29, and some apply to C++26. This is because
changes to the C++26 DIS (Draft of International Standard) have been
approved, while work on the C++29 Working Draft continues.
[CI] Support stacked PRs in compile-time job (#243940)
Allow /compile-time on PRs that target a branch other than main, such as
stacked PRs. The base branch is pushed as one commit on top of its merge
base with main and the PR goes on top of that commit, so the PR can be
compared against the branch it is based on. The base commit has a fixed
author, date and message so reruns reuse its results. PRs to release
branches are still rejected.
Assisted-By: Claude Code Opus 5.5
[VPlan] Compute last active lane of the header mask from the IV. (#243795)
After the last vector iteration, the last active lane of the header mask
is BTC - CanonicalIV. Use it instead of the generic LastActiveLane
lowering. If the header mask has no other users, it is not materialized.
The epilogue offsets the canonical IV, which the new Sub needs, so allow
Sub users there.
PR: https://github.com/llvm/llvm-project/pull/243795
[AMDGPU] Assume nonzero EXEC at kernel entry for VA_VDST
Waves are launched with at least one active lane, so in a kernel EXEC
can only become zero at an EXEC write that may produce zero. Until such
a write, VALUs after an always-issued VALU are issued as well and may
credit its accesses as VA_VDST successors.
Track this per bracket. It starts set in entry functions, is cleared by
EXEC writes that may produce zero, and merges by intersection. Blocks of
an entry function propagate their state even with no pending events, so
a cleared fact reaches every merge.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Stop crediting skippable VALUs as VA_VDST successors
When EXEC is zero most VALUs are skipped and never increment VA_VDST,
but lane accesses, V_NOP, VALUs that write an SGPR, VCC or NULL, and
WMMA/SWMMAC are still issued. A skipped VALU therefore must not count as
a successor of a pending access that was issued, which happens across
EXEC writes and after these always-issued VALUs.
Mark pending accesses at EXEC writes, and the accesses of always-issued
VALUs. A marked access keeps the count it had already earned and is
otherwise credited only by later always-issued VALUs and ordered XDL
writes. A later skippable access to the same register does not clear
the mark. Partial waits keep unsatisfied marked accesses pending, and
merges take the smaller count.
Assisted-by: Claude
[AMDGPU] Ignore EXEC writes that cannot zero EXEC for VA_VDST
Only an EXEC write that may produce zero can cause later VALUs to be
skipped. Moves of a nonzero immediate, ORs and WQMs of EXEC, and
S_OR_SAVEEXEC keep a nonzero EXEC nonzero, so pending VA_VDST accesses
keep their credit across them.
Assisted-by: Claude
[AMDGPU][GlobalISel] Legalize G_MERGE_VALUES/G_UNMERGE_VALUES wider than max scalar
Treat a merge/unmerge whose combined type is wider than the largest
scalar as legal when each piece is already a legal register type.
Co-authored-by: Cursor <cursoragent at cursor.com>
[AMDGPU] Assume nonzero EXEC at kernel entry for VA_VDST
Waves are launched with at least one active lane, so in a kernel EXEC
can only become zero at an EXEC write that may produce zero. Until such
a write, VALUs after an always-issued VALU are issued as well and may
credit its accesses as VA_VDST successors.
Track this per bracket. It starts set in entry functions, is cleared by
EXEC writes that may produce zero, and merges by intersection. Blocks of
an entry function propagate their state even with no pending events, so
a cleared fact reaches every merge.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU][NFC] Precommit tests for VA_VDST in kernels with nonzero EXEC
Record current waitcnt behavior for always-issued VALUs in kernels,
with and without EXEC writes before them.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[SDAG] Simplify expandVECTOR_COMPRESS (#246657)
Simplifies expandVECTOR_COMPRESS to select between the load and the
passthrough at the end (rather than storing the passthrough first). This
seems to result in more compact code on AArch64/X86.
[SandboxVec][LoadStoreVec] Vectorize store chains whose loads have external uses
Loads that feed a store chain used to block vectorization whenever they
had more than one use. The store chain can now be vectorized even if the
loads have external uses. Once the scalar stores are erased, each
original load is rebuilt from the lanes it occupies in the new vector
load, and reinterpreted back to its original type if needed.
The legality check, canUnpack(), runs before any IR is created, so a load
whose lanes cannot be reinterpreted (for example, a non-integral pointer)
rejects the whole chain instead of leaving a partially rewritten block.
The unpacking itself is done by unpackIfNeeded() after the scalar stores
have been removed.
Update the store_seeds.ll and mixed_types.ll checks to match the new
output.
Co-authored-by: Cursor <cursoragent at cursor.com>
[CodeGenPrepare] Sink GEPs of gathers/scatters into the access block (#242746)
[CodeGenPrepare] Sink GEPs of gathers/scatters into the access block
SelectionDAGBuilder::getUniformBase only looks through a GEP defined in
the same block as the gather/scatter, since SelectionDAG is built one
block at a time. optimizeGatherScatterInst canonicalized such GEPs into
the "scalar base + vector index" form, but bailed out if the GEP was in
another block, with a FIXME to sink it instead.
This depends on https://github.com/llvm/llvm-project/pull/242745 where
the tests are precommitted.
This is common after LICM hoists a loop-invariant vector GEP out of a
loop, or after GVN shares a GEP between accesses to different fields of
a
vector of structs. The address is then materialized as a vector of
pointers in the defining block, kept live across the loop, and the
gathers/scatters use it with a zero base. E.g. on x86 each field gets a
vector of 64-bit pointers in the preheader, and AVX2 splits each gather
[41 lines not shown]
[MC][NFC] Replace MCAsmInfo::evaluateAsRelocatableImpl with func ptr (#246744)
Avoid a virtual function by using a function pointer for evaluating
specifier exprs. Saves ~400B of .data.rel.ro.
[Clang][AMDGPU] Remove R600 target support
Remove the r600 triple from the clang frontend, driver and CodeGen,
together with the `__R600__` macro and the `__builtin_r600_*` builtins.
AMDGPUTargetInfo now only handles amdgcn, so the R600 branches are gone.
```
$ clang --target=r600 -S test.cl
error: unknown target triple 'r600'
```
RFC: https://discourse.llvm.org/t/rfc-amdgpu-deprecating-and-removing-llvm-s-r600-terascale-backend/92840
[Clang][AMDGPU] Remove redundant isAMDGCN checks. NFC
After the r600 target removal, AMDGPUTargetInfo is only created for
the amdgcn triple, so every `isAMDGCN()` check in it is always true.
Drop those checks and the helpers that only wrapped them.
```
if (hasFMAF())
Builder.defineMacro("__HAS_FMAF__");
-->
Builder.defineMacro("__HAS_FMAF__");
```
RFC: https://discourse.llvm.org/t/rfc-amdgpu-deprecating-and-removing-llvm-s-r600-terascale-backend/92840
[clang-diff] Switch to OptTable (#246766)
Parse the command line with OptTable instead of cl::opt, as part of
removing cl::opt from clang/. Help output uses the OptTable format, and
LLVM's global options (e.g. -debug-only, --version) are no longer
accepted.
LLM-aided
[docs] Document signature of builtin functions more consistently (#246637)
This greatly increases the consistency in how the signature of builtin
functions is documented. Historically, only some of the intrinsics had a
proper pseudo-C++ declaration, only some provided a documented return
type, etc. Also, the formatting (west-pointer vs. east-pointer) was
inconsistent, and some declarations used `type` to express generics
while others use `T`.
This patch also fixes some more severe documentation issues:
- `__builtin_unpredictable` was documented to operate on `long long`,
but actually operates on `long`.
- `__builtin_bitreverseg` is undocumented.
---------
Co-authored-by: Timm Baeder <tbaeder at redhat.com>