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
Merge branch 'main' into users/chfast/x86-frozen-loads-reverse
[spr] initial version Created using spr 2.0.0-beta.2
| Delta | File | |
|---|---|---|
| +3 | -2 | llvm/docs/ProgrammersManual.md |
| +3 | -2 | 1 files |
Revert "[mlir][SPIR-V] Add SPIRVToLLVM conversion for INTEL function pointer …" This reverts commit 8d4b6bdd7b759b2ed20cc79f20a4da0d73eab79c.
| Delta | File | |
|---|---|---|
| +8 | -28 | mlir/lib/Conversion/SPIRVToLLVM/SPIRVToLLVM.cpp |
| +0 | -27 | mlir/test/Conversion/SPIRVToLLVM/func-ops-to-llvm.mlir |
| +8 | -55 | 2 files |
[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
| Delta | File | |
|---|---|---|
| +1 | -1 | llvm/unittests/ADT/APFloatTest.cpp |
| +1 | -1 | 1 files |
[spr] initial version Created using spr 2.0.0-beta.2
| Delta | File | |
|---|---|---|
| +8 | -4 | llvm/lib/Target/ARM/MCTargetDesc/ARMMCAsmInfo.cpp |
| +8 | -4 | 1 files |
[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]| Delta | File | |
|---|---|---|
| +89 | -4 | mlir/lib/Conversion/OpenACCToLLVM/ACCAtomicPatterns.cpp |
| +42 | -0 | mlir/test/Conversion/OpenACCToLLVM/atomic.mlir |
| +10 | -0 | mlir/test/Conversion/OpenACCToLLVM/atomic-diagnostics.mlir |
| +141 | -4 | 3 files |
[libc++abi] Represent the status of side casts more compactly
| Delta | File | |
|---|---|---|
| +43 | -8 | libcxxabi/src/private_typeinfo.cpp |
| +7 | -1 | libcxxabi/src/private_typeinfo.h |
| +50 | -9 | 2 files |
[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 ```
Add O0 support
| Delta | File | |
|---|---|---|
| +29 | -0 | llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.consume.O0.ll |
| +10 | -6 | llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp |
| +39 | -6 | 2 files |
Update for comments
| Delta | File | |
|---|---|---|
| +31 | -0 | llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.consume.err.ll |
| +7 | -1 | llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp |
| +38 | -1 | 2 files |
[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]| Delta | File | |
|---|---|---|
| +708 | -345 | llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.consume.ll |
| +708 | -345 | llvm/test/CodeGen/AMDGPU/llvm.amdgcn.ds.append.ll |
| +52 | -25 | llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp |
| +1,468 | -715 | 3 files |
Update
| Delta | File | |
|---|---|---|
| +44 | -2 | llvm/test/CodeGen/AMDGPU/cgp-addressing-modes.ll |
| +44 | -2 | 1 files |
[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]| Delta | File | |
|---|---|---|
| +0 | -51 | llvm/test/CodeGen/AMDGPU/cgp-addressing-modes.ll |
| +0 | -2 | llvm/lib/Target/AMDGPU/SIISelLowering.cpp |
| +0 | -53 | 2 files |
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
[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.
| Delta | File | |
|---|---|---|
| +0 | -1 | clang-tools-extra/test/clang-tidy/checkers/bugprone/macro-condition.cpp |
| +0 | -1 | 1 files |
[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
| Delta | File | |
|---|---|---|
| +640 | -0 | llvm/test/CodeGen/SPARC/fp-strict.ll |
| +8 | -8 | llvm/lib/Target/Sparc/SparcInstrInfo.td |
| +648 | -8 | 2 files |
Update ProfileYAMLMapping.h
| Delta | File | |
|---|---|---|
| +1 | -1 | bolt/include/bolt/Profile/ProfileYAMLMapping.h |
| +1 | -1 | 1 files |
Merge branch 'main' into users/chfast/x86-ifma-novlx-patterns
[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.
| Delta | File | |
|---|---|---|
| +53 | -0 | libclc/test/conformance/integer/mad_sat.cl |
| +6 | -12 | libclc/clc/lib/generic/integer/clc_mad_sat.cl |
| +59 | -12 | 2 files |
[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>
Apply review feedback
| Delta | File | |
|---|---|---|
| +4 | -4 | llvm/test/tools/llvm-strings/encoding.test |
| +1 | -1 | llvm/tools/llvm-strings/Opts.td |
| +2 | -0 | llvm/tools/llvm-strings/llvm-strings.cpp |
| +7 | -5 | 3 files |
[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.[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)];
}
```
| Delta | File | |
|---|---|---|
| +5 | -12 | llvm/test/Transforms/InstCombine/ctpop.ll |
| +6 | -0 | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp |
| +11 | -12 | 2 files |
Precommit tests
| Delta | File | |
|---|---|---|
| +41 | -0 | llvm/test/Transforms/InstCombine/ctpop.ll |
| +41 | -0 | 1 files |
[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.
| Delta | File | |
|---|---|---|
| +6 | -22 | llvm/test/Transforms/InstCombine/ctpop.ll |
| +11 | -0 | llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp |
| +17 | -22 | 2 files |
Precommit tests
| Delta | File | |
|---|---|---|
| +145 | -0 | llvm/test/Transforms/InstCombine/ctpop.ll |
| +145 | -0 | 1 files |
[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.
| Delta | File | |
|---|---|---|
| +10 | -30 | llvm/test/Transforms/InstCombine/ctpop.ll |
| +8 | -0 | llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp |
| +18 | -30 | 2 files |
[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)
| Delta | File | |
|---|---|---|
| +121 | -0 | llvm/test/Transforms/InstCombine/vec_phi_extract.ll |
| +8 | -1 | llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp |
| +129 | -1 | 2 files |
[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.| Delta | File | |
|---|---|---|
| +4 | -0 | lldb/source/Plugins/Highlighter/TreeSitter/CMakeLists.txt |
| +1 | -1 | lldb/source/Plugins/Highlighter/TreeSitter/TreeSitterHighlighter.h |
| +5 | -1 | 2 files |
Precommit tests
| Delta | File | |
|---|---|---|
| +169 | -0 | llvm/test/Transforms/InstCombine/ctpop.ll |
| +169 | -0 | 1 files |