LLVM/project c09d9bf — llvm/lib/Transforms/IPO DeadArgumentElimination.cpp, llvm/test/Assembler captures.ll

[IR] Enforce pointer return type for `captures(ret: ...)` attribute annotation (#243407)

Following up on a discussion based on
https://github.com/llvm/llvm-project/pull/238026#discussion_r4584703141,
reject `captures` attribute with return-only components on function and
call-site parameters when the return type is not a pointer.
Particularly, this excludes vector and aggregate return types,
consistent with how CaptureTracking currently treats a pointer inserted
into an aggregate or vector as captured.
DeltaFile
+38-0llvm/test/Transforms/DeadArgElim/captures-ret.ll
+21-15llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
+20-0llvm/test/Transforms/InstCombine/call-cast-captures-ret.ll
+18-0llvm/test/Verifier/captures-ret.ll
+8-8llvm/test/Assembler/captures.ll
+14-0llvm/test/Transforms/PGOProfile/indirect-call-promotion-captures-ret.ll
+119-236 files not shown
+165-2612 files

LLVM/project 758e057 — llvm/test/CodeGen/X86/apx inline-spiller-hoist-folded-copy.ll

[X86][APX] Keep hoist-folded-copy test effective

inline-spiller-hoist-folded-copy.ll reproduces a null VNInfo
dereference in HoistSpillHelper that needs greedy to fold a spill
into the COPY inserted by an NDD reload fold. SlotIndexes compaction
shortens the outer loop in index space, greedy spills differently,
and the test passes even with the fix reverted.

Add four empty asm statements to lengthen the loop again. The test
then crashes without the fix whether compaction is on or off.
DeltaFile
+35-21llvm/test/CodeGen/X86/apx/inline-spiller-hoist-folded-copy.ll
+35-211 files

LLVM/project d785197 — llvm/test/CodeGen/X86 vector-interleaved-store-i64-stride-7.ll vector-deinterleave8-i64.ll

[X86] Enable SlotIndexes compaction by default

Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.

Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.

Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for.
DeltaFile
+20,796-20,889llvm/test/CodeGen/X86/vector-interleave7-i16.ll
+17,854-17,989llvm/test/CodeGen/X86/vector-interleave7-i32.ll
+17,166-17,229llvm/test/CodeGen/X86/vector-interleave6-i16.ll
+15,403-15,465llvm/test/CodeGen/X86/vector-interleaved-load-i64-stride-7.ll
+13,433-13,434llvm/test/CodeGen/X86/vector-deinterleave8-i64.ll
+13,329-13,243llvm/test/CodeGen/X86/vector-interleaved-store-i64-stride-7.ll
+97,981-98,249514 files not shown
+673,197-675,740520 files

LLVM/project c39bdac — llvm/test/CodeGen/X86/apx reloc-opt.ll

[X86][APX] Test the relocation of an NF add

test_regclass_not_updated_by_regalloc_2 only produced an NDD/NF add
with a GOT operand because the allocator happened to give the add a
destination different from its source. With SlotIndexes compaction it
picks the same register, so the add is compressed to the legacy form
and the CODE_6 TODO lost its test.

Add a function whose add keeps its source live, so it stays NDD and
becomes NF under any allocation.
DeltaFile
+20-1llvm/test/CodeGen/X86/apx/reloc-opt.ll
+20-11 files

LLVM/project b929ed2 — libcxx/include/__algorithm pstl.h, libcxx/include/__pstl/backends serial.h

[libc++][pstl] Add a serial implementation of std::unique_copy (#245603)

This PR adds a serial implementation of `std::unique_copy` to PSTL.
A real parallel implementation is intended to land within the `statpart`
backend later, which will be a purely additive change, it will not touch
the code in this PR.

Part of #99938.
DeltaFile
+225-0libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/pstl.unique_copy_pred.pass.cpp
+221-0libcxx/test/std/algorithms/alg.modifying.operations/alg.unique/pstl.unique_copy.pass.cpp
+41-0libcxx/include/__algorithm/pstl.h
+14-0libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp
+14-0libcxx/include/__pstl/backends/serial.h
+12-0libcxx/test/libcxx/algorithms/pstl.iterator-requirements.verify.cpp
+527-02 files not shown
+538-08 files

LLVM/project 1573da1 — llvm/lib/Transforms/Instrumentation GCOVProfiling.cpp, llvm/test/Transforms/GCOVProfiling function-numbering.ll

[GCOVProfiling] Enable IRBuilder GEP canonicalization (#246316)
DeltaFile
+18-15llvm/test/Transforms/GCOVProfiling/function-numbering.ll
+0-1llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp
+18-162 files

LLVM/project f850bc4 — flang/lib/Optimizer/Transforms DebugTypeGenerator.cpp, flang/test/Integration debug-pdt-instance-names.f90

[flang][debug] Name instance of a parameterized type after its kinds (#245692)

The instances of a parameterized derived type all took the name of the
type, so a debugger could not tell them apart. With `pdt(4)` and
`pdt(8)` used in the same procedure, `ptype pdt` in gdb showed whichever
instance it found first.

Name an instance after its kind values as gfortran does, `PDTpdt_4` for
`pdt(4)` (earlier gfortran spell the prefix `Pdt`). The prefix keeps an
instance from taking the name of a plain type such as `pdt_4`. gfortran
puts a negative value in the name with its minus sign, which a debugger
cannot look up, so spell it as the uniqued name does: `PDTpdt_N1` for
`pdt(-1)`.

Assisted by: Cursor

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+42-0flang/test/Integration/debug-pdt-instance-names.f90
+29-0flang/test/Transforms/debug-pdt-instance-names.fir
+20-1flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
+91-13 files

LLVM/project d8e1281 — llvm/lib/CodeGen MachineVerifier.cpp, llvm/lib/Target/AArch64 AArch64InstrInfo.td

Run verfier checks for physregs as well
DeltaFile
+27-2llvm/test/MachineVerifier/early-clobber-aarch64.mir
+20-0llvm/test/CodeGen/ARM/cmp-swap-64-early-clobber.mir
+8-7llvm/lib/CodeGen/MachineVerifier.cpp
+7-1llvm/lib/Target/ARM/ARMInstrInfo.td
+5-2llvm/lib/Target/AArch64/AArch64InstrInfo.td
+67-125 files

LLVM/project 5daaef7 — libcxx/include/__algorithm pstl.h, libcxx/include/__pstl backend_fwd.h

[libc++][pstl] Add a serial implementation of std::inplace_merge (#245218)

This PR adds a serial implementation of `std::inplace_merge` to PSTL.
Currently there's no intent to provide a parallel version of this
algorithm, but later it can be added as well.

Part of #99938.
DeltaFile
+159-0libcxx/test/std/algorithms/alg.sorting/alg.merge/pstl.inplace_merge_comp.pass.cpp
+155-0libcxx/test/std/algorithms/alg.sorting/alg.merge/pstl.inplace_merge.pass.cpp
+36-0libcxx/include/__algorithm/pstl.h
+15-0libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp
+15-0libcxx/include/__pstl/backends/serial.h
+9-0libcxx/include/__pstl/backend_fwd.h
+389-01 files not shown
+396-07 files

LLVM/project 79ef948 — clang/include/clang/StaticAnalyzer/Core/PathSensitive MemRegion.h SymExpr.h, clang/lib/StaticAnalyzer/Core SymbolManager.cpp MemRegion.cpp

[analyzer][NFC] Remove padding from MemRegion and SymExpr (#246313)

Cache the region offset without std::optional, using a null region for
"not computed", and make the SymExpr kind 8 bits so that the opcode of
UnarySymExpr and BinarySymExpr fits into its tail padding. This shrinks
MemRegion and its subclasses by 8 bytes, and on Itanium ABI targets also
UnarySymExpr and BinarySymExpr.

Assisted-by: Claude Opus 5.5

---------

Co-authored-by: Gabor Horvath <gaborh at apple.com>
DeltaFile
+14-6clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h
+7-3clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymExpr.h
+4-2clang/lib/StaticAnalyzer/Core/MemRegion.cpp
+2-1clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h
+1-1clang/lib/StaticAnalyzer/Core/SymbolManager.cpp
+28-135 files

LLVM/project 317e096 — libcxx/include/__numeric reduce.h transform_reduce.h

[libc++] Speed-up the reduction by up to 4X by breaking the dependency chain (#234887)

This PR changes `std::reduce`/`std::transform_reduce()` to process 4
elements per iteration and perform reduction in a tree-like manner:
```
__init--------------\
                    (X) -> __init
__first[0]\         /
          (X)\     /
__first[1]/   \   /
              (X)/
__first[2]\   /
          (X)/
__first[3]/
```
This optimisation applies only when random-access iterators to floating-point numbers are passed into `std::reduce`/`std::transform_reduce()`.
DeltaFile
+24-0libcxx/include/__numeric/transform_reduce.h
+10-0libcxx/include/__numeric/reduce.h
+34-02 files

LLVM/project c00b8f1 — lldb/source/Target Thread.cpp, lldb/test/API/functionalities/scripted_frame_provider/set_pc main.c frame_provider.py

Revert "[lldb] Compare the concrete frame index for inlining (#240963)"

This reverts commit 17b5443a3211f7956d700fc520b1540a78ed8688.
DeltaFile
+0-201lldb/unittests/Target/Inputs/tail-call.yaml
+0-97lldb/unittests/Target/StackFrameListTest.cpp
+0-45lldb/test/API/functionalities/scripted_frame_provider/set_pc/TestFrameProviderSetPC.py
+0-21lldb/test/API/functionalities/scripted_frame_provider/set_pc/frame_provider.py
+0-14lldb/test/API/functionalities/scripted_frame_provider/set_pc/main.c
+1-8lldb/source/Target/Thread.cpp
+1-3864 files not shown
+5-40010 files

LLVM/project 996aca0 — llvm/lib/CodeGen MachineVerifier.cpp LiveIntervals.cpp

Comments
DeltaFile
+1-1llvm/lib/CodeGen/MachineVerifier.cpp
+1-1llvm/lib/CodeGen/LiveIntervals.cpp
+2-22 files

LLVM/project 1033208 — mlir/include/mlir/Dialect/LLVMIR NVVMEnums.td NVVMOps.td

[NFC][MLIR][NVVM] Move enum definitions to NVVMEnums.td (#243880)

This NFC moves enums defined in `NVVMOps.td` to `NVVMEnums.td` to allow
for better organization and also for reuse in the NVGPU dialect.

This follows https://github.com/llvm/llvm-project/pull/195811/.
DeltaFile
+0-893mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
+875-0mlir/include/mlir/Dialect/LLVMIR/NVVMEnums.td
+875-8932 files

LLVM/project f4561f1 — libcxx/include type_traits module.modulemap.in, libcxx/include/__type_traits is_trivially_destructible.h is_nothrow_destructible.h

[libc++] Assume __is_{,nothrow_,trivially_}destructible builtins are available (#246195)

The `__is_destructible`, `__is_trivially_destructible` and
`__is_nothrow_destructible` builtins are available in all compilers we
support, so we can remove the now unused implementations. Since the
implementations are rather small now, this patch also merges the three
headers into `is_destructible.h`.
DeltaFile
+13-62libcxx/include/__type_traits/is_destructible.h
+0-61libcxx/include/__type_traits/is_nothrow_destructible.h
+0-47libcxx/include/__type_traits/is_trivially_destructible.h
+0-8libcxx/include/module.modulemap.in
+0-2libcxx/include/type_traits
+1-1libcxx/include/__utility/small_buffer.h
+14-18111 files not shown
+21-19317 files

LLVM/project d69f502 — libcxx/include/__iterator iterator_traits.h

[libc++] Simplify the implementation of iterator_traits a bit (#222297)

This change does a few things:
- remove concepts which have only a single use
- use functions returning `type_identity`s instead of specializing a
class
- use `__detected_or_t`
All of these changes simplify the implementation a bit, resulting in
quite a bit less code.
DeltaFile
+35-98libcxx/include/__iterator/iterator_traits.h
+35-981 files

LLVM/project 41d4262 — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Merge dst_type_might_be_derived_from_static_type into path_dst_ptr_to_static_ptr
DeltaFile
+17-32libcxxabi/src/private_typeinfo.cpp
+1-1libcxxabi/src/private_typeinfo.h
+18-332 files

LLVM/project 59bd52f — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Only store a single dst_ptr
DeltaFile
+12-16libcxxabi/src/private_typeinfo.cpp
+2-4libcxxabi/src/private_typeinfo.h
+14-202 files

LLVM/project bda79f4 — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Remove found_our_static_ptr and found_any_static_type from __dynamic_cast_info
DeltaFile
+107-128libcxxabi/src/private_typeinfo.cpp
+4-6libcxxabi/src/private_typeinfo.h
+111-1342 files

LLVM/project 5a8cc7b — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Make the dst_type uniqueness flag in dynamic_cast a bool (#243530)

`number_of_dst_type` is only ever 0 or 1. Capture that fact by making it
a bool.
DeltaFile
+6-7libcxxabi/src/private_typeinfo.cpp
+2-2libcxxabi/src/private_typeinfo.h
+8-92 files

LLVM/project c622ffa — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Remove has_path_to_static_ptr from dynamic_cast (#244144)

`path_dst_ptr_to_static_ptr` already contains whether we found a path to
static_ptr, so there is no need to track it separately.
DeltaFile
+7-13libcxxabi/src/private_typeinfo.cpp
+0-2libcxxabi/src/private_typeinfo.h
+7-152 files

LLVM/project c760599 — libcxxabi/src private_typeinfo.h private_typeinfo.cpp

[libc++abi] Return a result type inside dynamic_cast (#243517)
DeltaFile
+110-99libcxxabi/src/private_typeinfo.cpp
+36-30libcxxabi/src/private_typeinfo.h
+146-1292 files

LLVM/project d0e6a4c — llvm/test/Transforms/LoopVectorize fmax-without-fast-math-flags-interleave.ll fmax-select-without-fast-math-flags-tail-folding.ll, llvm/test/Transforms/LoopVectorize/AArch64 fmax-without-fast-math-flags.ll

[LV] Vectorize select-based FP min/max reductions without fast-math. (#243462)

Model select(fcmp) FP min/max reductions without nnan/nsz as new
FMinSelect/FMaxSelect recurrence kinds and handle them like
FMinNum/FMaxNum in handleMaxMinNumReductions: exit the vector loop early
on NaN inputs and re-execute the last vector iteration in the scalar
loop.

Selects pick one of two equal operands depending on their order, and
equal non-NaN values only differ in the sign of zero, so also exit early
on -0.0 inputs, or +0.0 if the start value is -0.0. Restrict this to
IEEE types with IEEE denormals, as otherwise equal values can differ in
more than the sign of zero, and the vector reduction may flush
denormals. Non-constant and NaN start values are not supported yet.

Only use the select's fast-math flags, as nsz on its fcmp does not apply
to the result. Drop nnan/ninf from the selects using the reduction phi,
and set nnan on the reduction result, which cannot be NaN, to avoid
fmin/fmax libcalls.

    [6 lines not shown]
DeltaFile
+405-73llvm/test/Transforms/LoopVectorize/fmax-without-fast-math-flags.ll
+373-58llvm/test/Transforms/LoopVectorize/fmin-without-fast-math-flags.ll
+202-36llvm/test/Transforms/LoopVectorize/fmax-select-without-fast-math-flags-tail-folding.ll
+176-0llvm/test/Transforms/LoopVectorize/VPlan/vplan-printing-reductions.ll
+112-19llvm/test/Transforms/LoopVectorize/fmax-without-fast-math-flags-interleave.ll
+83-10llvm/test/Transforms/LoopVectorize/AArch64/fmax-without-fast-math-flags.ll
+1,351-19615 files not shown
+1,693-25121 files

LLVM/project cf1c752 — offload/libompaccsupport/include device.h, offload/libompaccsupport/src device.cpp

[Offload][Omp] Use olMemCpy3D in omp_target_memcpy_rect

Implement olMemCpyRect more generically in DeviceTy using the
accelerated olMemCy3D if supported by the device.

Use it to reimplement omp_target_memcpy_rect.

Assisted by Claude.
DeltaFile
+291-0offload/libompaccsupport/src/device.cpp
+124-0offload/test/api/omp_target_memcpy_rect_3d.c
+40-27offload/libomptarget/src/API.cpp
+47-0offload/libompaccsupport/include/device.h
+502-274 files

LLVM/project 00497c7 — offload/liboffload/API Memory.td, offload/liboffload/src OffloadImpl.cpp

Add fallback support
DeltaFile
+98-17offload/liboffload/src/OffloadImpl.cpp
+26-15offload/unittests/OffloadAPI/memory/olMemcpy3D.cpp
+27-6offload/plugins-nextgen/cuda/src/rtl.cpp
+17-13offload/plugins-nextgen/amdgpu/src/rtl.cpp
+9-9offload/plugins-nextgen/common/include/PluginInterface.h
+5-4offload/liboffload/API/Memory.td
+182-644 files not shown
+185-7310 files

LLVM/project 5dee5ba — llvm/lib/Analysis VectorUtils.cpp, llvm/test/Transforms/LoopVectorize/AArch64 loop-vectorization-factors.ll

[VectorUtils] Exempt root users from the out-of-the-chain check

computeMinimumValueSizes bails out when it finds a not visited
integer user of a visited value. The main motivation for this
is to avoid adding extra casts.

For roots (currently it's truncs and icmps), this is overly
conservative. Shrinking these instructions only changes their
operands but not their result types. Because of this root's users
won't need additional casts.

For the reference, SLP made a similar relaxation for its own
minimum bitwidth analysis in #72679.
DeltaFile
+24-20llvm/test/Transforms/LoopVectorize/AArch64/loop-vectorization-factors.ll
+14-4llvm/lib/Analysis/VectorUtils.cpp
+6-3llvm/test/Transforms/LoopVectorize/RISCV/gather-scatter-cost.ll
+44-273 files

LLVM/project 12f6745 — lldb/source/Plugins/TypeSystem/Clang TypeSystemClang.cpp

[lldb][NFC] Remove redundant zero assignments in TypeSystemClang

TypeSystemClang::GetChildAtIndex starts from a value-initialized
ChildTypeInfo, so it doesn't need to set byte_offset to 0.

assisted by claude

DeltaFile
+0-4lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+0-41 files

LLVM/project 0226440 — llvm/lib/Target/RISCV RISCVTargetTransformInfo.cpp, llvm/test/Transforms/LoopUnroll/RISCV outer-loop-unroll-threshold.ll

[RISCV] Limit outer-loop unrolling (#244182)

At O3, LLVM fully unrolls an outer loop in a hotspot found in SPEC
CPU 2026 `706.stockfish_r`, duplicating its inner vector loop 16 times.

Cap the full-unroll threshold at the partial-unroll threshold for
non-innermost loops. Small loops and explicit unroll requests can
still unroll.

With `-march=rv64gcv -O3`, the reproducer shrinks from 1550 to 128
bytes.

QEMU instruction counting also shows 8.45%, 8.11%, and 7.43% fewer
instructions at VLEN=128, 256, and 512, respectively.

This matches GCC partially since GCC is conservative as well here.

Reproducer: https://godbolt.org/z/8b9KPYd3d

Assisted-by: TRAE CLI (GPT-6)
DeltaFile
+1,344-0llvm/test/Transforms/LoopUnroll/RISCV/outer-loop-unroll-threshold.ll
+6-1llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+1,350-12 files

LLVM/project cdf7026 — lldb/source/Plugins/DynamicLoader/MacOSX-DYLD DynamicLoaderDarwin.cpp

[lldb][Clike] Don't require TypeSystemClang for TLS lookup (#238953)

DynamicLoaderDarwin::GetThreadLocalData doesn't need to direclty
reference TypeSystemClang. Instead, we can get away by using generic
TypeSystem API calls that also work with TypeSystemClike.
DeltaFile
+10-4lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+10-41 files

LLVM/project ae1fc04 — llvm/lib/Target/NVPTX NVPTXIntrinsics.td NVPTXISelLowering.cpp, llvm/test/CodeGen/NVPTX tcgen05-ld-red-spcompress-invalid.ll tcgen05-ld-spcompress-invalid.ll

[NVVM][NVPTX] Add tcgen05.ld{.red}.spcompress intrinsics (#242037)

This change supports `tcgen05.ld.spcompress` and
`tcgen05.ld.red.spcompress` intrinsics and their lowerings to the NVPTX
backend.
DeltaFile
+1,087-0llvm/test/CodeGen/NVPTX/tcgen05-ld-red-spcompress.ll
+527-0llvm/test/CodeGen/NVPTX/tcgen05-ld-spcompress.ll
+95-1llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+75-0llvm/test/CodeGen/NVPTX/tcgen05-ld-spcompress-invalid.ll
+70-0llvm/lib/Target/NVPTX/NVPTXIntrinsics.td
+69-0llvm/test/CodeGen/NVPTX/tcgen05-ld-red-spcompress-invalid.ll
+1,923-13 files not shown
+2,022-19 files