LLVM/project d8d4847llvm/lib/Target/NVPTX NVPTXInstrInfo.td NVPTXISelDAGToDAG.cpp, llvm/test/CodeGen/NVPTX fmax3.ll

[NVPTX] Fuse abs into min/max

Fold absolute-value operands into existing three-input f32 min/max
instructions on SM100 with PTX 8.8 or newer. This replaces separate
absolute-value instructions with the min/max .abs modifier.
DeltaFile
+141-0llvm/test/CodeGen/NVPTX/fmax3.ll
+16-0llvm/lib/Target/NVPTX/NVPTXInstrInfo.td
+16-0llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
+173-03 files

LLVM/project 4007459llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes SeedCollection.cpp

[SandboxVec][NFC] Make sbvec-collect-seeds a static opt
DeltaFile
+1-1llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/SeedCollection.cpp
+1-11 files

LLVM/project 469437dllvm/include/llvm/Transforms/Vectorize/SandboxVectorizer DependencyGraph.h Legality.h, llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes LoadStoreVec.h

[SandboxVec][NFC] Replace ArrayRef witn BndlRef (#224077)
DeltaFile
+5-6llvm/lib/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.cpp
+5-5llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Passes/LoadStoreVec.h
+5-5llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h
+3-4llvm/lib/Transforms/Vectorize/SandboxVectorizer/Legality.cpp
+1-2llvm/lib/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.cpp
+2-1llvm/include/llvm/Transforms/Vectorize/SandboxVectorizer/DependencyGraph.h
+21-232 files not shown
+23-258 files

LLVM/project 8862254llvm/lib/Target/NVPTX NVPTXTargetTransformInfo.cpp, llvm/test/Transforms/InstCombine/NVPTX nvvm-intrins.ll

[NVPTX] Fold abs into redux intrinsics

Fold llvm.fabs into the absolute-value variants of floating-point
redux min/max intrinsics during InstCombine.
DeltaFile
+37-1llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
+32-0llvm/test/Transforms/InstCombine/NVPTX/nvvm-intrins.ll
+69-12 files

LLVM/project 8fd566ellvm/lib/Target/RISCV RISCVISelLowering.cpp

fixup! Address review comments
DeltaFile
+20-20llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+20-201 files

LLVM/project bb9a57allvm/include/llvm/Analysis TargetTransformInfoImpl.h TargetTransformInfo.h, llvm/lib/Analysis TargetTransformInfo.cpp

[SLP] More accurately cost RISCV scalar splats (#213104)

Backends may have a fast path for splatting scalar operands (i.e. rather
than generating the splat vector, the vector instruction may be able to
take a scalar operand), for example RISCV `vfoo.vx` instructions. Pass a
hint to the TTI when costing the insert/shuffle sequence in such cases.

Fixes #212413.

Assisted By: Codex
DeltaFile
+133-55llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+42-6llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+11-31llvm/test/Transforms/SLPVectorizer/RISCV/check-node-without-vector-user.ll
+29-2llvm/include/llvm/Analysis/TargetTransformInfo.h
+18-3llvm/lib/Analysis/TargetTransformInfo.cpp
+14-5llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+247-10223 files not shown
+340-17629 files

LLVM/project e20824cllvm/test/CodeGen/RISCV/rvv vector-interleave-fixed.ll

fixup! Rebase
DeltaFile
+725-1,253llvm/test/CodeGen/RISCV/rvv/vector-interleave-fixed.ll
+725-1,2531 files

LLVM/project 4aeec59llvm/include/llvm/ExecutionEngine/Orc/Shared ConnectionSpec.h, llvm/lib/ExecutionEngine/Orc/Shared CMakeLists.txt ConnectionSpec.cpp

[ORC] Add ConnectionSpec for connection string parsing (#224000)

A ConnectionSpec is the parsed form of a string describing one
connection a process should establish with its peer:

  <transport>[:<action>]=<descriptor>

E.g. "fd=3" or "tcp:connect=localhost:20000". The parser only checks
punctuation: transport and action names are opaque tokens, and the
descriptor's syntax is left to the transport, which lets a descriptor
contain ':' and '=' unescaped (e.g. "tcp:listen=[::1]:0").

This will be used by llvm-jitlink and llvm-jitlink-executor to
generalize out-of-process executor connection setup beyond the current
fd/TCP-only options.
DeltaFile
+106-0llvm/unittests/ExecutionEngine/Orc/ConnectionSpecTest.cpp
+74-0llvm/include/llvm/ExecutionEngine/Orc/Shared/ConnectionSpec.h
+38-0llvm/lib/ExecutionEngine/Orc/Shared/ConnectionSpec.cpp
+1-0llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
+1-0llvm/lib/ExecutionEngine/Orc/Shared/CMakeLists.txt
+220-05 files

LLVM/project d1ac09ellvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv vector-interleave.ll

[RISCV] Eliminate redundant VSLIDEDOWN_VL/VSLIDEUP_VL pairs
DeltaFile
+23-103llvm/test/CodeGen/RISCV/rvv/vector-interleave.ll
+55-3llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+78-1062 files

LLVM/project 8e2bf7bllvm/test/CodeGen/RISCV/rvv vector-deinterleave.ll

fixup! Update more tests
DeltaFile
+12-45llvm/test/CodeGen/RISCV/rvv/vector-deinterleave.ll
+12-451 files

LLVM/project a0a4f29clang/test/OpenMP declare_variant_scoring.c, flang/test/Lower/OpenMP metadirective-target-boundary.f90 declare-variant-construct.f90

[clang][flang][OpenMP] Correct OpenMP context selector matching and scoring

Context selector ranking is shared by DECLARE VARIANT and metadirective
lowering. Incorrect construct matches, context-dependent device weights, or
overflowing scores can select a different variant and cause Flang to skip
required loop diagnostics.

Preserve the highest-scoring ordered construct matches and derive device
weights from the enclosing context. Widen score arithmetic as needed, and
retain selector identity and scores for unknown properties so MATCH_ANY and
MATCH_NONE handle dynamic conditions and implicit NOTHING correctly. Bound
lowering contexts at TARGET and include SIMD traits so Clang and Flang use
the same context for selection.

Assisted with codex.
DeltaFile
+311-1llvm/unittests/Frontend/OpenMPContextTest.cpp
+115-94llvm/lib/Frontend/OpenMP/OMPContext.cpp
+185-6flang/test/Lower/OpenMP/metadirective-user.f90
+119-2flang/test/Lower/OpenMP/declare-variant-construct.f90
+92-0clang/test/OpenMP/declare_variant_scoring.c
+62-0flang/test/Lower/OpenMP/metadirective-target-boundary.f90
+884-1036 files not shown
+972-13012 files

LLVM/project ba019b7llvm/lib/Target/Sparc SparcISelDAGToDAG.cpp, llvm/test/CodeGen/SPARC bswap.ll

[SPARC] Fix SelectForceADDRrr for global addresses and non-reg operands (#220013)

When lowering byte-swapped memory operations on SPARC V9, LLVM emits
ASI-tagged memory instructions (such as STHArr, STArr, LDArr, etc.) that
require register+register addressing modes matched via ForceADDRrr.

SelectForceADDRrr previously forwarded 2-operand address nodes directly
to SelectADDRrr. However, SelectADDRrr explicitly returns false when
encountering SPISD::Lo (used in %hi/%lo global address calculations) or
small constant offsets in order to allow standard ADDRri patterns to
match. Because SelectForceADDRrr returned the result of SelectADDRrr
directly instead of falling back to Base = Addr, Disp = %g0, any
endian-adjusted load or store targeting a global variable failed to
select and caused a backend compiler crash:
  "Cannot select: SPISD::STORE_LITTLE ..."

Fix SelectForceADDRrr so that if SelectADDRrr fails to match, it falls
back to evaluating the full address into a base register and using %g0
as the offset register. Also add tests for global variable byte-swapped

    [7 lines not shown]
DeltaFile
+201-0llvm/test/CodeGen/SPARC/bswap.ll
+2-5llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+203-52 files

LLVM/project 82fc843libcxx/include/__algorithm find_if.h, libcxx/test/libcxx/algorithms unaligned_empty_range.pass.cpp

[libc++] Don't assume a valid range in find_if for empty inputs (#213752)

Iterators for empty ranges are sometimes implemented using a
non-aligned sentinel value. Requiring proper alignment in that
case (which is part of the valid range assumption) causes a
hardening failure. Instead, don't make the assumption of a
valid range when the input range is empty in find_if.

(cherry picked from commit 83290d61f6ead40a5c38297a0442b63291ce7a48)
DeltaFile
+83-0libcxx/test/libcxx/algorithms/unaligned_empty_range.pass.cpp
+8-1libcxx/include/__algorithm/find_if.h
+91-12 files

LLVM/project 2eabe80libcxx/include __hash_table __tree, libcxx/include/__utility try_key_extraction.h

[libc++] Opt `std::*set` out of map key extraction optimization (#220452)

PR #154512 (relanded by #155565) removed `__can_extract_map_key`, which
had a blanket opt-out for `std::*set`s. The new logic does not have that
opt-out, leading to `std::set`s being incorrectly constructed.

The new regression tests demonstrate this, but essentially the idea is:
1. Have `std::set<T> foo;`
2. Call `foo.emplace(some_t,
arg_that_influences_comparisons_or_hashes);`
3. The emplace will internally search using `some_t` as the key, *not*
`T(some_t, arg_that_influences_comparisons_or_hashes);`

This opts out `std::*set` from this optimization to match previous
behavior.

Tests and fix were produced by an LLM. I reviewed them and they seem
reasonable to me, though I don't have a strong background in libc++
testing conventions.

    [7 lines not shown]
DeltaFile
+10-6libcxx/include/__utility/try_key_extraction.h
+16-0libcxx/test/std/containers/associative/set/emplace.pass.cpp
+10-0libcxx/test/std/containers/unord/unord.set/emplace.pass.cpp
+3-3libcxx/include/__tree
+1-1libcxx/include/__hash_table
+40-105 files

LLVM/project 3936f33llvm/lib/Target/DirectX DXILOpLowering.cpp, llvm/test/CodeGen/DirectX Sample.ll SampleBias.ll

[DirectX] Make DXILOpLowering split vector coordinates, offsets, and gradient operands (#223091)

Fixes https://github.com/llvm/llvm-project/issues/217777

DXILOpLowering didn't split vector coordinates, offsets, and gradient
operands into scalars for textureLoad, textureStore, and sample
intrinsics like it did for store data. This PR fixes that.

This PR also removes inconsistencies where the DXILOpLowering pass
emitted a mix of i64 and i32 indices for `extractelement`. It now just
emits i32 indices.

Assisted by: Claude Opus 5
DeltaFile
+96-53llvm/test/CodeGen/DirectX/SampleGrad.ll
+74-41llvm/lib/Target/DirectX/DXILOpLowering.cpp
+80-18llvm/test/CodeGen/DirectX/TextureStore.ll
+55-31llvm/test/CodeGen/DirectX/TextureLoad.ll
+55-19llvm/test/CodeGen/DirectX/SampleBias.ll
+54-19llvm/test/CodeGen/DirectX/Sample.ll
+414-1813 files not shown
+560-2099 files

LLVM/project ea715dcclang/test/CodeGenHLSL/builtins RWBuffer-Interlocked.hlsl RasterizerOrderedByteAddressBuffer-InterlockedCompareExchangeFloatBitwise.hlsl, clang/test/SemaHLSL/BuiltIns ByteAddressBuffer-InterlockedCompareExchangeFloatBitwise-sm60.hlsl InterlockedCompareExchangeFloatBitwise-errors.hlsl

First attempt implementing InterlockedCompareExchangeFloatBitwise



DeltaFile
+119-0clang/test/SemaHLSL/BuiltIns/InterlockedCompareExchangeFloatBitwise-errors.hlsl
+43-0clang/test/CodeGenHLSL/builtins/InterlockedCompareExchangeFloatBitwise.hlsl
+42-0clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedCompareExchangeFloatBitwise-sm60.hlsl
+32-0clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedCompareExchangeFloatBitwise.hlsl
+25-0clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedCompareExchangeFloatBitwise.hlsl
+10-0clang/test/CodeGenHLSL/builtins/RWBuffer-Interlocked.hlsl
+271-05 files not shown
+298-311 files

LLVM/project ed548efclang/test/SemaHLSL/BuiltIns InterlockedExchange-errors.hlsl ByteAddressBuffer-InterlockedExchangeFloat-sm60.hlsl, llvm/lib/Target/DirectX DXILResourceAccess.cpp DXILLegalizePass.cpp

First attempt implementing float InterlockedExchange
DeltaFile
+40-0clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedExchangeFloat-sm60.hlsl
+39-0llvm/test/CodeGen/DirectX/LegalizeAtomicExchangeFloat.ll
+38-0llvm/test/CodeGen/DirectX/ResourceAtomicExchangeFloat.ll
+21-14clang/test/SemaHLSL/BuiltIns/InterlockedExchange-errors.hlsl
+29-0llvm/lib/Target/DirectX/DXILLegalizePass.cpp
+17-3llvm/lib/Target/DirectX/DXILResourceAccess.cpp
+184-178 files not shown
+246-2814 files

LLVM/project b449a85clang/lib/Sema SemaHLSL.cpp, clang/test/CodeGenHLSL/builtins RWByteAddressBuffer-InterlockedCompareStoreFloatBitwise.hlsl InterlockedCompareStoreFloatBitwise.hlsl

First attempt implementing InterlockedCompareStoreFloatBitwise



DeltaFile
+100-0clang/test/SemaHLSL/BuiltIns/InterlockedCompareStoreFloatBitwise-errors.hlsl
+39-0clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedCompareStoreFloatBitwise-sm60.hlsl
+35-0clang/test/CodeGenHLSL/builtins/InterlockedCompareStoreFloatBitwise.hlsl
+30-0llvm/test/CodeGen/DirectX/ResourceAtomicCompareStoreFloat.ll
+27-0clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedCompareStoreFloatBitwise.hlsl
+16-6clang/lib/Sema/SemaHLSL.cpp
+247-66 files not shown
+311-1012 files

LLVM/project 734da5aclang/lib/Sema HLSLExternalSemaSource.cpp SemaHLSL.cpp, clang/test/CodeGenHLSL/builtins RasterizerOrderedByteAddressBuffer-InterlockedCompareExchange.hlsl RWByteAddressBuffer-InterlockedCompareExchange.hlsl

First attempt implementing InterlockedCompareExchange



DeltaFile
+93-81clang/lib/Sema/SemaHLSL.cpp
+113-0clang/test/SemaHLSL/BuiltIns/InterlockedCompareExchange-errors.hlsl
+70-0clang/test/CodeGenHLSL/builtins/InterlockedCompareExchange.hlsl
+41-24clang/lib/Sema/HLSLExternalSemaSource.cpp
+44-0clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedCompareExchange.hlsl
+35-0clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedCompareExchange.hlsl
+396-1056 files not shown
+480-12212 files

LLVM/project 0086b63llvm/include/llvm/IR IntrinsicsDirectX.td, llvm/lib/Target/DirectX DXILOpLowering.cpp DXILResourceAccess.cpp

First attempt implementing DXIL compare exchange infrastructure
DeltaFile
+94-18llvm/lib/Target/DirectX/DXILResourceAccess.cpp
+57-0llvm/test/CodeGen/DirectX/ResourceAtomicCompareExchange.ll
+41-0llvm/lib/Target/DirectX/DXILOpLowering.cpp
+17-0llvm/test/CodeGen/DirectX/ResourceAtomicCompareExchangeTexture-errors.ll
+17-0llvm/test/CodeGen/DirectX/ResourceAtomicCompareExchange-i64-sm65.ll
+12-0llvm/include/llvm/IR/IntrinsicsDirectX.td
+238-181 files not shown
+249-187 files

LLVM/project 5a50516clang/lib/CodeGen CGHLSLBuiltins.cpp, clang/lib/Sema HLSLExternalSemaSource.cpp

First attempt implementing InterlockedCompareStore
DeltaFile
+88-0clang/test/SemaHLSL/BuiltIns/InterlockedCompareStore-errors.hlsl
+54-0clang/test/CodeGenHLSL/builtins/InterlockedCompareStore.hlsl
+45-7clang/lib/Sema/HLSLExternalSemaSource.cpp
+37-0llvm/test/CodeGen/DirectX/ResourceAtomicCompareStore.ll
+29-7clang/lib/CodeGen/CGHLSLBuiltins.cpp
+36-0clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedCompareStore.hlsl
+289-147 files not shown
+397-1613 files

LLVM/project 8592037clang/test/CodeGenHLSL/builtins RWTexture-Interlocked.hlsl

Add InterlockedExchange coverage to the texture test
DeltaFile
+7-0clang/test/CodeGenHLSL/builtins/RWTexture-Interlocked.hlsl
+7-01 files

LLVM/project 58fbce3clang/test/CodeGenHLSL/builtins RasterizerOrderedByteAddressBuffer-InterlockedExchange.hlsl RWByteAddressBuffer-InterlockedExchange.hlsl, clang/test/SemaHLSL/BuiltIns ByteAddressBuffer-InterlockedExchange-sm65-errors.hlsl ByteAddressBuffer-InterlockedExchange-errors.hlsl

First attempt implementing interlockedexchange
DeltaFile
+107-0clang/test/SemaHLSL/BuiltIns/InterlockedExchange-errors.hlsl
+48-0clang/test/CodeGenHLSL/builtins/InterlockedExchange.hlsl
+46-0clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedExchange-errors.hlsl
+40-0clang/test/CodeGenHLSL/builtins/RWByteAddressBuffer-InterlockedExchange.hlsl
+29-0clang/test/CodeGenHLSL/builtins/RasterizerOrderedByteAddressBuffer-InterlockedExchange.hlsl
+26-0clang/test/SemaHLSL/BuiltIns/ByteAddressBuffer-InterlockedExchange-sm65-errors.hlsl
+296-07 files not shown
+352-1613 files

LLVM/project dcae8adclang/test/CodeGenHLSL/builtins RWTexture-Interlocked.hlsl

Add InterlockedMax coverage to the texture test
DeltaFile
+10-0clang/test/CodeGenHLSL/builtins/RWTexture-Interlocked.hlsl
+10-01 files

LLVM/project 1fbc28allvm/lib/Target/RISCV RISCVISelLowering.cpp, llvm/test/CodeGen/RISCV/rvv vector-interleave-fixed.ll

fixup! Simplify the combine conditions
DeltaFile
+1,792-4,579llvm/test/CodeGen/RISCV/rvv/vector-interleave-fixed.ll
+19-53llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+1,811-4,6322 files

LLVM/project e8bdb0eutils/bazel/llvm-project-overlay/libc/test libc_test_rules.bzl, utils/bazel/llvm-project-overlay/libc/test/UnitTest BUILD.bazel

[bazel][test][libc] Use clock LLVM-libc entrypoint in overlay tests
DeltaFile
+2-6utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+1-1utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
+3-72 files

LLVM/project f5b5ff6utils/bazel/llvm-project-overlay/libc/test libc_test_rules.bzl, utils/bazel/llvm-project-overlay/libc/test/include BUILD.bazel

[test][bazel][libc] Fix dependencies for some tests under full-build
DeltaFile
+82-59utils/bazel/llvm-project-overlay/libc/test/include/BUILD.bazel
+37-4utils/bazel/llvm-project-overlay/libc/test/src/stdio/BUILD.bazel
+16-4utils/bazel/llvm-project-overlay/libc/test/src/string/BUILD.bazel
+6-2utils/bazel/llvm-project-overlay/libc/utils/MPCWrapper/BUILD.bazel
+3-3utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+4-1utils/bazel/llvm-project-overlay/libc/utils/MPFRWrapper/BUILD.bazel
+148-736 files

LLVM/project 2243fc1utils/bazel/llvm-project-overlay/libc/startup/linux startup_rules.bzl, utils/bazel/llvm-project-overlay/libc/test libc_test_rules.bzl

[test][bazel][libc] Allow LLVM-libc tests to be run in full-build mode

This PR makes the required changes to run LLVM-libc full build tests in Bazel. After this PR, most tests pass:

```
bazel test @llvm-project//libc/test/... --config=ci --@llvm-project//libc:build_mode=full --keep_going
Executed 680 out of 853 tests: 681 tests pass and 172 fail to build.
```

Follow on PRs will fix specific tests that are failing (lots of missing deps etc).

This PR mostly involves propagating the correct dependencies and compiler/linker options from [`add_libc_hermetic`](https://github.com/llvm/llvm-project/blob/4098f568c46e06b6df470111868b4c165dd80f4d/libc/cmake/modules/LLVMLibCTestRules.cmake#L750). Slightly more involved changes:
- `BazelFilePath.cpp` also had to be fixed so that it doesn't depend on the non-namespaced `getenv` function. This PR models after https://github.com/llvm/llvm-project/commit/ee407f7e7069cccfdc1815de07e17cebf83d19f9 in order to conditionally use LLVM-libc's getenv under full-build mode.
- All tests have a dependency against `crt1.o` when run under full-build. This PR updates `merge_relocatable_object` so it also exposes a `CcInfo` with the merged object file and its transitive deps. In order to do so, this PR also makes the logic a little more careful about PIC vs non-PIC deps.
DeltaFile
+59-17utils/bazel/llvm-project-overlay/libc/test/libc_test_rules.bzl
+48-3utils/bazel/llvm-project-overlay/libc/test/UnitTest/BUILD.bazel
+19-0utils/bazel/llvm-project-overlay/libc/startup/linux/startup_rules.bzl
+126-203 files

LLVM/project a9ea77flibc/test/UnitTest BazelFilePath.cpp

[bazel][libc] Do not depend on system `getenv` in BazelFilePath.cpp

This PR models after https://github.com/llvm/llvm-project/commit/ee407f7e7069cccfdc1815de07e17cebf83d19f9 in order to conditionally use LLVM-libc's `getenv` when compiling in full-build mode.
DeltaFile
+13-3libc/test/UnitTest/BazelFilePath.cpp
+13-31 files

LLVM/project 059358autils/bazel/llvm-project-overlay/libc BUILD.bazel

[bazel][libc] Allow libc:types_char8_t to compile in full-build mode (#223872)
DeltaFile
+4-4utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+4-41 files