LLVM/project f7e7b9d — clang/test/Modules lsv-objc.m, llvm/test/CodeGen/AArch64 sve-fixed-length-masked-expandloads.ll sve-interleaved-accesses.ll

Merge branch 'main' into users/chfast/x86-frozen-loads-reverse
DeltaFile
+688-788llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-bf16.ll
+1,449-0llvm/test/CodeGen/RISCV/xqcilo-xqcilia-sfb-frame-index.ll
+413-668llvm/test/CodeGen/AArch64/sve-interleaved-accesses.ll
+477-544llvm/test/CodeGen/AArch64/sve-fixed-length-masked-expandloads.ll
+980-1llvm/test/CodeGen/RISCV/xqcilo-xqcilia-frame-index.ll
+926-0clang/test/Modules/lsv-objc.m
+4,933-2,001623 files not shown
+22,669-5,803629 files

LLVM/project cdba512 — llvm/docs ProgrammersManual.md

[spr] initial version

Created using spr 2.0.0-beta.2
DeltaFile
+3-2llvm/docs/ProgrammersManual.md
+3-21 files

LLVM/project 9a28bcf — mlir/lib/Conversion/SPIRVToLLVM SPIRVToLLVM.cpp, mlir/test/Conversion/SPIRVToLLVM func-ops-to-llvm.mlir

Revert "[mlir][SPIR-V] Add SPIRVToLLVM conversion for INTEL function pointer …"

This reverts commit 8d4b6bdd7b759b2ed20cc79f20a4da0d73eab79c.
DeltaFile
+8-28mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp
+0-27mlir/test/Conversion/SPIRVToLLVM/func-ops-to-llvm.mlir
+8-552 files

LLVM/project 0fe9633 — llvm/unittests/ADT APFloatTest.cpp

[ADT][Test] Fix APFloatTest -Wmicrosoft-cast error with clang-cl (#247479)

The `APFloatTest` added in #242370 fails to build with `clang-cl
-Werror`
because LLVM's gtest adapter implicitly converts the `std::hex` function
pointer to `const void *`, triggering `-Wmicrosoft-cast`. Format the
value
with `utohexstr`.

Assisted-by: Claude Code
DeltaFile
+1-1llvm/unittests/ADT/APFloatTest.cpp
+1-11 files

LLVM/project 9b8cfc9 — llvm/lib/Target/ARM/MCTargetDesc ARMMCAsmInfo.cpp

[spr] initial version

Created using spr 2.0.0-beta.2
DeltaFile
+8-4llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp
+8-41 files

LLVM/project 7605ebd — mlir/lib/Conversion/OpenACCToLLVM ACCAtomicPatterns.cpp, mlir/test/Conversion/OpenACCToLLVM atomic-diagnostics.mlir atomic.mlir

[mlir][acc] Fix `acc.atomic.read` lowering when `v` or `x` is complex

`acc.atomic.read` allows `v` and `x` of different types, and the value
read from `x` is converted to the type of `v`. The LLVM lowering
converted between the types used for the atomic access, where a complex
value is an integer of the same size. So a complex `x` was converted as
an integer, and a complex `v` was the target of an integer conversion.
For example:

```mlir
acc.atomic.read %v = %x : !fir.ref<f32>, !fir.ref<complex<f32>>, complex<f32>
```

was lowered to

```mlir
%rmw = llvm.atomicrmw _or %x, %zero monotonic : !llvm.ptr, i64
%val = llvm.sitofp %rmw : i64 to f32
```

    [24 lines not shown]
DeltaFile
+89-4mlir/lib/Conversion/OpenACCToLLVM/ACCAtomicPatterns.cpp
+42-0mlir/test/Conversion/OpenACCToLLVM/atomic.mlir
+10-0mlir/test/Conversion/OpenACCToLLVM/atomic-diagnostics.mlir
+141-43 files

LLVM/project 9a691a6 — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Represent the status of side casts more compactly
DeltaFile
+43-8libcxxabi/src/private_typeinfo.cpp
+7-1libcxxabi/src/private_typeinfo.h
+50-92 files

LLVM/project c557330 — llvm/lib/Target/AMDGPU AMDGPUInstructionSelector.h AMDGPUInstructionSelector.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.ds.append.consume.err.ll llvm.amdgcn.ds.append.consume.O0.ll

[AMDGPU][GlobalISel] Fix ds_append/ds_consume addressing

This matches the SelectionDAG fix. For LDS, ds_append and ds_consume
address memory only through the 16 bit instruction offset and ignore
M0, but the selector copied the pointer base into M0. Select a constant,
dword aligned LDS address into the offset field and diagnose any other
LDS address as unsupported.

For GDS, the offset field must be zero and the address comes from
M0.base, so build M0 as `(addr << 16) | gds_size`. Using GDS on a
subtarget without GDS is now diagnosed.

```
; call i32 @llvm.amdgcn.ds.append.p3(ptr addrspace(3) inttoptr (i32 16 to ptr addrspace(3)), i1 false)
; before
s_mov_b32 m0, 16
ds_append v0
; after
ds_append v0 offset:16
```
DeltaFile
+323-596llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.consume.ll
+323-596llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.ll
+59-25llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+34-13llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.consume.O0.ll
+1-1llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
+1-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.consume.err.ll
+741-1,2316 files

LLVM/project ce3ada7 — llvm/lib/Target/AMDGPU AMDGPUISelDAGToDAG.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.ds.append.consume.O0.ll

Add O0 support
DeltaFile
+29-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.consume.O0.ll
+10-6llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+39-62 files

LLVM/project 01661a4 — llvm/lib/Target/AMDGPU AMDGPUISelDAGToDAG.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.ds.append.consume.err.ll

Update for comments
DeltaFile
+31-0llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.consume.err.ll
+7-1llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+38-12 files

LLVM/project 4abad60 — llvm/lib/Target/AMDGPU AMDGPUISelDAGToDAG.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.ds.consume.ll llvm.amdgcn.ds.append.ll

[AMDGPU] Fix ds_append/ds_consume addressing in SelectionDAG

For LDS, ds_append and ds_consume address memory only through the 16 bit
instruction offset. M0 is not used, but isel put the pointer (or its
base) into M0, so the counter was read at the wrong address. Select a
constant, dword aligned LDS address into the offset field and diagnose
any other LDS address as unsupported.

For GDS, the ISA requires the offset field to be zero and takes the
address from M0.base, so pack the whole address into M0 as
`(addr << 16) | gds_size`. Using GDS on a subtarget without GDS is now
diagnosed instead of silently encoding a GDS bit.

```
; call i32 @llvm.amdgcn.ds.append.p3(ptr addrspace(3) inttoptr (i32 16 to ptr addrspace(3)), i1 false)
; before
s_mov_b32 m0, 16
ds_append v0
; after

    [4 lines not shown]
DeltaFile
+708-345llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.consume.ll
+708-345llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.ll
+52-25llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
+1,468-7153 files

LLVM/project 77abc33 — llvm/test/CodeGen/AMDGPU cgp-addressing-modes.ll

Update
DeltaFile
+44-2llvm/test/CodeGen/AMDGPU/cgp-addressing-modes.ll
+44-21 files

LLVM/project 782f96e — llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU cgp-addressing-modes.ll

[AMDGPU] Stop sinking addresses into ds_append/ds_consume

ds_append and ds_consume have no address register operand. For LDS the
address comes only from the 16 bit offset field, and M0 is not used. The
register plus immediate DS addressing mode reported through
getAddrModeArguments does not apply, so CodeGenPrepare should not sink
address computations into these intrinsics.

```llvm
entry:
  %in.gep = getelementptr i32, ptr addrspace(3) %in, i32 7
  br i1 %cond, label %endif, label %if
if:
  %val = call i32 @llvm.amdgcn.ds.append.p3(ptr addrspace(3) %in.gep, i1 false)

; before: CodeGenPrepare sinks the address into %if
  %sunkaddr = getelementptr i8, ptr addrspace(3) %in, i32 28
  %val = call i32 @llvm.amdgcn.ds.append.p3(ptr addrspace(3) %sunkaddr, i1 false)
; after: the call keeps using %in.gep

    [5 lines not shown]
DeltaFile
+0-51llvm/test/CodeGen/AMDGPU/cgp-addressing-modes.ll
+0-2llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+0-532 files

LLVM/project a63ea3e — compiler-rt/cmake/Modules AddCompilerRT.cmake, compiler-rt/lib/fuzzer CMakeLists.txt

Reapply "[cmake][compiler-rt] Use INSTALL_BYPRODUCTS" (#247996)

Adds `install` to `STEP_TARGETS` to resolve the revert reason.

Re-Applies: fa96d7affdc201eec1052aa83783bd59259b19ea
Re-Applies: 947fe7d0341edebfecacfb34866cd71afb183ee7
Reverts: e5708ea4c27a20b4b5da2dc9666866f138bf2f8e
DeltaFile
+2-17compiler-rt/cmake/Modules/AddCompilerRT.cmake
+3-3compiler-rt/lib/msan/tests/CMakeLists.txt
+3-3compiler-rt/lib/fuzzer/CMakeLists.txt
+1-1compiler-rt/lib/tsan/CMakeLists.txt
+1-1compiler-rt/lib/fuzzer/tests/CMakeLists.txt
+10-255 files

LLVM/project 537b912 — clang-tools-extra/test/clang-tidy/checkers/bugprone macro-condition.cpp

[clang-tidy] Avoid including host header in macro-condition test (#247641)

The macro-condition test uses __has_include(<sys/file.h>) and includes
the header. This change fixes the cross-compilation issue reported in
https://github.com/llvm/llvm-project/issues/243520

Actually including <sys/file.h> is unnecessary and can break
cross-compiler builds when Clang's default target does not match the
build host. For example, the host header may select a target-specific
GNU stubs header that is not installed.

Remove the include while retaining the __has_include condition and its
original test coverage.
DeltaFile
+0-1clang-tools-extra/test/clang-tidy/checkers/bugprone/macro-condition.cpp
+0-11 files

LLVM/project 8806d83 — llvm/lib/Target/Sparc SparcInstrInfo.td, llvm/test/CodeGen/SPARC fp-strict.ll

[SPARC] Keep the chain on strict FP conversions and compares (#247983)

List the strict node first in the pattern fragment. TableGen uses the
first alternative to determine if the instruction has a chain. Otherwise
the instruction loses the chain and instructions that might raise an
exception can get deleted if the result is not used.

Assisted-by: Claude
DeltaFile
+640-0llvm/test/CodeGen/SPARC/fp-strict.ll
+8-8llvm/lib/Target/Sparc/SparcInstrInfo.td
+648-82 files

LLVM/project 794fb62 — bolt/include/bolt/Profile ProfileYAMLMapping.h

Update ProfileYAMLMapping.h
DeltaFile
+1-1bolt/include/bolt/Profile/ProfileYAMLMapping.h
+1-11 files

LLVM/project aa9b1c1 — clang/test/Modules lsv-objc.m, llvm/test/CodeGen/AArch64 sve-fixed-length-masked-expandloads.ll sve-interleaved-accesses.ll

Merge branch 'main' into users/chfast/x86-ifma-novlx-patterns
DeltaFile
+688-788llvm/test/CodeGen/AArch64/sve-fixed-length-fp-extend-bf16.ll
+1,449-0llvm/test/CodeGen/RISCV/xqcilo-xqcilia-sfb-frame-index.ll
+413-668llvm/test/CodeGen/AArch64/sve-interleaved-accesses.ll
+477-544llvm/test/CodeGen/AArch64/sve-fixed-length-masked-expandloads.ll
+980-1llvm/test/CodeGen/RISCV/xqcilo-xqcilia-frame-index.ll
+926-0clang/test/Modules/lsv-objc.m
+4,933-2,001616 files not shown
+22,010-5,768622 files

LLVM/project ebb0852 — libclc/clc/lib/generic/integer clc_mad_sat.cl, libclc/test/conformance/integer mad_sat.cl

[libclc] Fix __clc_mad_sat for 64-bit signed integers (#246034)

The signed 64-bit implementation predicted overflow from the signs of
the operands and returned wrong results for several inputs, e.g.
mad_sat(0, -5, 7) returned LONG_MIN. Compute x * y + z exactly as a
128-bit value and saturate only if it does not fit in 64 bits.
DeltaFile
+53-0libclc/test/conformance/integer/mad_sat.cl
+6-12libclc/clc/lib/generic/integer/clc_mad_sat.cl
+59-122 files

LLVM/project 62e1f86 — mlir/docs PassManagement.md, mlir/lib/TableGen Pass.cpp

[mlir][tblgen] Add `cppNamespace` to passes (#247681)

The code generated by `-gen-pass-decls` has no notion of a namespace and
is placed wherever the generated file is included, which in practice is
always inside a namespace. The generator can therefore not emit anything
that has to live at global scope, such as includes or forward
declarations.

Add a `cppNamespace` field to `PassBase`, similar to the one of
dialects. Passes that set it place their generated code in that
namespace themselves, and the generated file must then be included at
global scope. The group registration is placed in the innermost
namespace enclosing the namespaces of all passes of the group, if any.
Passes without a namespace behave as before.

This makes namespace handling of passes also consistent with the rest
the of MLIR.

---------

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+170-0mlir/test/mlir-tblgen/pass-cpp-namespace.td
+34-32mlir/tools/mlir-tblgen/PassGen.cpp
+39-0mlir/docs/PassManagement.md
+28-9mlir/tools/mlir-tblgen/PassCAPIGen.cpp
+30-0mlir/lib/TableGen/Pass.cpp
+24-0mlir/unittests/TableGen/PassGenTest.cpp
+325-413 files not shown
+350-419 files

LLVM/project da6ebf1 — llvm/test/tools/llvm-strings encoding.test, llvm/tools/llvm-strings Opts.td llvm-strings.cpp

Apply review feedback
DeltaFile
+4-4llvm/test/tools/llvm-strings/encoding.test
+1-1llvm/tools/llvm-strings/Opts.td
+2-0llvm/tools/llvm-strings/llvm-strings.cpp
+7-53 files

LLVM/project c2bb81b — llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp, llvm/lib/Target/ARM ARMBranchTargets.cpp

[Target] Use new skipMetaInstructions{Forward,Backward} helpers (NFC) (#247158)

Replace all loops that obviously do nothing but skip meta instructions
with calls to the new helper functions from PR #230074.
DeltaFile
+6-11llvm/lib/Target/Sparc/LeonPasses.cpp
+4-6llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+2-4llvm/lib/Target/Sparc/DelaySlotFiller.cpp
+2-3llvm/lib/Target/X86/X86MCInstLower.cpp
+2-3llvm/lib/Target/X86/X86InsertX87Wait.cpp
+1-3llvm/lib/Target/ARM/ARMBranchTargets.cpp
+17-306 files

LLVM/project a8816d9 — llvm/lib/Transforms/InstCombine InstCombineAddSub.cpp, llvm/test/Transforms/InstCombine ctpop.ll

[InstCombine] Fold trunc(ctpop(A)) + trunc(ctpop(B)) -> trunc(ctpop(A) + ctpop(B))

This allows the combine added in #231321 to kick in and fold the motivating ctpop case in automotive-bitcount:

```c
static char bits[256] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8};

int CDECL ntbl_bitcount(long int x)
{
      return
            bits[ (int) (x & 0x0000000FUL)       ] +
            bits[ (int)((x & 0x000000F0UL) >> 4) ] +
            bits[ (int)((x & 0x00000F00UL) >> 8) ] +
            bits[ (int)((x & 0x0000F000UL) >> 12)] +
            bits[ (int)((x & 0x000F0000UL) >> 16)] +
            bits[ (int)((x & 0x00F00000UL) >> 20)] +
            bits[ (int)((x & 0x0F000000UL) >> 24)] +
            bits[ (int)((x & 0xF0000000UL) >> 28)];
}
```
DeltaFile
+5-12llvm/test/Transforms/InstCombine/ctpop.ll
+6-0llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+11-122 files

LLVM/project 0ec4180 — llvm/test/Transforms/InstCombine ctpop.ll

Precommit tests
DeltaFile
+41-0llvm/test/Transforms/InstCombine/ctpop.ll
+41-01 files

LLVM/project a516dd2 — llvm/lib/Transforms/InstCombine InstCombineAddSub.cpp, llvm/test/Transforms/InstCombine ctpop.ll

[InstCombine] Fold ctpop(X >> C) + ctpop(X & M) -> ctpop(X & (M | (-1 << C)))

Following up from #231225, automotive-bitcount in llvm-test-suite and GCC use a "per-nibble" ctpop table lookup, where they split the operation up into smaller ctpop table lookups over chunks of the input:

```c
unsigned table_u32(unsigned x) {
  static const unsigned char ctpop[16] = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4};
  return ctpop[x & 15] + ctpop[(x >> 4) & 15];
}
```

PR #231225 now converts the individual table lookups to ctpop intrinsics, so we're left with `ctpop(X & 0xf) + ctpop((X >> 4) & 0xf) + ctpop((X >> 8) & 0xf) + ...`. Now that `ctpop((X >> C) & M)` is canonicalized to `ctpop(X & (M << C))`, the existing `ctpop(A) + ctpop(B) -> ctpop(A | B)` fold for disjoint A and B combines most of these.

The one piece it can't handle is the top chunk of a full-width chain, which is a plain `ctpop(X >> C)` with no mask. This folds it with the lower bits directly.

This needs to come before the disjoint fold, which would otherwise combine e.g. `ctpop(X >> 12) + ctpop(X & 0xf00)` into `ctpop((X >> 12) | (X & 0xf00))`, which can't be folded any further.
DeltaFile
+6-22llvm/test/Transforms/InstCombine/ctpop.ll
+11-0llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+17-222 files

LLVM/project 3824017 — llvm/test/Transforms/InstCombine ctpop.ll

Precommit tests
DeltaFile
+145-0llvm/test/Transforms/InstCombine/ctpop.ll
+145-01 files

LLVM/project 66d3c88 — llvm/lib/Transforms/InstCombine InstCombineCalls.cpp, llvm/test/Transforms/InstCombine ctpop.ll

[InstCombine] Fold ctpop((X >> C) & M) -> ctpop(X & (M << C))

The position of the bits doesn't matter to ctpop so we can look through the shift. As suggested in https://github.com/llvm/llvm-project/pull/231321#discussion_r4358616796, this allows the existing ctpop(A) + ctpop(B) => ctpop(A | B) to kick in since it now knows there are no bits in common.
DeltaFile
+10-30llvm/test/Transforms/InstCombine/ctpop.ll
+8-0llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+18-302 files

LLVM/project 7ffeecf — llvm/lib/Transforms/InstCombine InstCombineVectorOps.cpp, llvm/test/Transforms/InstCombine vec_phi_extract.ll

[InstCombine] Fix scalarizePHI for phi inputs defined by a terminator (#247678)

scalarizePHI inserts the extract of each incoming value right after the
instruction that defines it. When that instruction is an `invoke` or a
`callbr`, there is nothing after it in its block, and InstCombine
asserts.

If it is the terminator of the phi's incoming block, its result is not
available anywhere in that block, so bail out. Otherwise insert the
extract at the start of the incoming block.

The issue reports the `callbr` case; `invoke` crashes the same way. The
new tests in vec_phi_extract.ll cover both, plus an invoke in an earlier
block, which now gets scalarized.

Fixes #247644

Assisted-by: Claude Code (Opus 5.5)
DeltaFile
+121-0llvm/test/Transforms/InstCombine/vec_phi_extract.ll
+8-1llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
+129-12 files

LLVM/project 0542d39 — lldb/source/Plugins/Highlighter/TreeSitter TreeSitterHighlighter.h CMakeLists.txt

[lldb] Fix building with Tree-sitter on Linux (#231535)

I tried building with a locally built tree-sitter, manually passing
TreeSitter_<...>_DIR. To get that to work I had to fix two things.

1. The lldb libraries need to build with the tree-sitter header paths
included.
2. For whatever reason, clang 20 doesn't deem TSState to be default
constructible with "= default" but it does with "{}". It must be default
constructible for the later m_ts_state.emplace() calls to work.
DeltaFile
+4-0lldb/source/Plugins/Highlighter/TreeSitter/CMakeLists.txt
+1-1lldb/source/Plugins/Highlighter/TreeSitter/TreeSitterHighlighter.h
+5-12 files

LLVM/project ea1dfee — llvm/test/Transforms/InstCombine ctpop.ll

Precommit tests
DeltaFile
+169-0llvm/test/Transforms/InstCombine/ctpop.ll
+169-01 files