LLVM/project 2da5cc7clang/lib/CIR/Dialect/Transforms CallConvLoweringPass.cpp, clang/test/CIR/CodeGen call-conv-lowering-x86_64-empty.cpp

[CIR] Accept a union with an ABI-empty member

isSupportedType rejected any union containing an ABI-empty member outright.
Dropping the reject alone is not enough.  A union mixing a data-free member
that spans the record with a bit-field access unit can still mis-lower.  The
new accept rule requires that a data-supplying member span the record
whenever a bit-field access unit is present.

mapCIRType's union loop now only maps members that hold data for the ABI,
so an unnamed bit-field's storage is not mapped as a field either.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+226-0clang/test/CIR/Transforms/abi-lowering/x86_64-union.cir
+92-0clang/test/CIR/CodeGen/call-conv-lowering-x86_64-empty.cpp
+14-18clang/test/CIR/Transforms/abi-lowering/x86_64-aggregate-nyi.cir
+19-10clang/lib/CIR/Dialect/Transforms/CallConvLoweringPass.cpp
+351-284 files

LLVM/project 23e604dlibcxx/docs ABIGuarantees.rst Hardening.rst

[libc++][docs] Document `std::optional` hardening (#218173)

Resolves #218041
DeltaFile
+7-1libcxx/docs/Hardening.rst
+2-2libcxx/docs/ABIGuarantees.rst
+9-32 files

LLVM/project 6a65e84libcxx/include/__configuration availability.h, libcxx/utils/libcxx/test/features availability.py

[libc++] Add availability for LLVM 22 on Apple platforms (#218518)
DeltaFile
+17-3libcxx/include/__configuration/availability.h
+1-1libcxx/utils/libcxx/test/features/availability.py
+18-42 files

LLVM/project 0daa20dclang/lib/CIR/CodeGen CIRGenBuiltinAArch64.cpp, clang/lib/CodeGen/TargetBuiltins ARM.cpp

[AArch64][llvm][clang] Add missing sv{set,get,dup}_neonq_mf8 intrinsics (#217577)

Add support for `svset_neonq_mf8`, `svget_neonq_mf8` and `svdup_neonq_mf8`
intrinsics, which are present in the ACLE but were not implemented in llvm.
DeltaFile
+16-0clang/test/CodeGen/aarch64_neon_sve_bridge_intrinsics/acle_neon_sve_bridge_dup_neonq.c
+14-1clang/test/CodeGen/aarch64_neon_sve_bridge_intrinsics/acle_neon_sve_bridge_get_neonq.c
+14-0clang/test/CodeGen/aarch64_neon_sve_bridge_intrinsics/acle_neon_sve_bridge_set_neonq.c
+13-0clang/lib/Headers/arm_neon_sve_bridge.h
+6-3clang/lib/CodeGen/TargetBuiltins/ARM.cpp
+3-0clang/lib/CIR/CodeGen/CIRGenBuiltinAArch64.cpp
+66-42 files not shown
+72-48 files

LLVM/project e0560c4libcxx/test/std/numerics/c.math fpclassify.pass.cpp signbit.pass.cpp

[libc++][math][NFC] Generalize test-suite improvement for `signbit` and `fpclassify` tests (#217897)

This patch generalizes the test-suite improvements for
`signbit.pass.cpp` and `fpclassify.pass.cpp` as per the review comments
present in https://github.com/llvm/llvm-project/pull/210075 for
consistency purposes.

Follows-up:
https://github.com/llvm/llvm-project/pull/210075#discussion_r3629842324
DeltaFile
+29-36libcxx/test/std/numerics/c.math/signbit.pass.cpp
+11-19libcxx/test/std/numerics/c.math/fpclassify.pass.cpp
+40-552 files

LLVM/project 23ddd3aclang/test/CIR/CodeGen attr-noundef.cpp call-conv-lowering-x86_64-byref.cpp

[CIR] Update CHECK lines for the nofreeobj rename (#218704)

#218404 renamed classic's indirect-argument attribute from nofree to
nofreeobj. Five OGCG lines across two tests still pinned the old
spelling.

Assisted-by: Cursor / claude-opus-5
DeltaFile
+3-3clang/test/CIR/CodeGen/call-conv-lowering-x86_64-byref.cpp
+2-2clang/test/CIR/CodeGen/attr-noundef.cpp
+5-52 files

LLVM/project 3fc62b8clang/test/CodeGen/LoongArch/lasx builtin-alias.c, llvm/lib/Frontend/OpenMP OMPDescriptors.inc

Merge branch 'main' into users/adams381/cir-callconv-vptr-record
DeltaFile
+9,921-0llvm/test/CodeGen/AArch64/vector-ldst-align-float.ll
+8,227-0llvm/test/CodeGen/AArch64/vector-ldst-align.ll
+3,448-2llvm/test/CodeGen/AArch64/vector-ldst-offset.ll
+2,421-285llvm/test/tools/llvm-mca/AArch64/Cortex/A57-forwarding.s
+2,386-0llvm/lib/Frontend/OpenMP/OMPDescriptors.inc
+733-733clang/test/CodeGen/LoongArch/lasx/builtin-alias.c
+27,136-1,0201,087 files not shown
+66,959-24,0091,093 files

LLVM/project 0260138clang/lib/CodeGen QualTypeMapper.cpp, llvm/include/llvm/ABI Types.h

[LLVMABI][NFC] Align base class handling with Clang's AST (#218545)

The LLVM ABI library's RecordType was omitting direct virtual base
classes from its base class vector, which was a divergence from the
representation in the Clang AST. Clang's AST includes direct virtual
bases in both the collection of base classes and the collection of
virtual bases.

Aligning the handling between the Clang AST and the LLVM ABI RecordType
will simplifying porting of ABI classification for future targets.

Assisted-by: Cursor / various models
DeltaFile
+14-7clang/lib/CodeGen/QualTypeMapper.cpp
+12-2llvm/include/llvm/ABI/Types.h
+6-0llvm/lib/ABI/Targets/X86.cpp
+4-0llvm/lib/ABI/Types.cpp
+36-94 files

LLVM/project 4c2f518llvm/test/Transforms/SLPVectorizer/AArch64 revec-reductions.ll

[SLP][NFC]Replace constant by the real argument, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/218714
DeltaFile
+5-4llvm/test/Transforms/SLPVectorizer/AArch64/revec-reductions.ll
+5-41 files

LLVM/project c85444cllvm/lib/Transforms/Utils BuildLibCalls.cpp, llvm/test/Transforms/InferFunctionAttrs annotate.ll

[Transforms] Infer attributes for posix_memalign
DeltaFile
+8-0llvm/lib/Transforms/Utils/BuildLibCalls.cpp
+2-1llvm/test/Transforms/InferFunctionAttrs/annotate.ll
+10-12 files

LLVM/project a3b89e9clang/lib/AST/ByteCode Program.cpp

[clang][bytecode][NFC] Fix redundant DenseMap lookup (#218689)
DeltaFile
+1-1clang/lib/AST/ByteCode/Program.cpp
+1-11 files

LLVM/project b17ab25llvm/include/llvm/Transforms/Utils ScalarEvolutionExpander.h, llvm/lib/Transforms/Utils ScalarEvolutionExpander.cpp

[SCEVExp] Factor out findExistingExpansionAndDropPoisonFlags helper (NFC) (#218700)

Move out helper to find an existing expanded value to re-use.

Preparation for a follow-up patch.
DeltaFile
+16-9llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
+5-0llvm/include/llvm/Transforms/Utils/ScalarEvolutionExpander.h
+21-92 files

LLVM/project e576c77libc/src/__support/OSUtil/linux/syscall_wrappers wait4.h, libc/src/sys/wait wait4Impl.h

[libc] Port wait4 to the syscall_wrappers ladder (#218699)

wait4Impl.h carried its own SYS_wait4/SYS_waitid fallback while
syscall_wrappers/wait4.h assumed SYS_wait4 exists, so the wrapper failed
to build on architectures that only provide waitid, such as rv32.
DeltaFile
+0-91libc/src/sys/wait/wait4Impl.h
+63-0libc/src/__support/OSUtil/linux/syscall_wrappers/wait4.h
+3-15libc/src/sys/wait/linux/CMakeLists.txt
+3-2libc/src/sys/wait/linux/waitpid.cpp
+3-2libc/src/sys/wait/linux/wait4.cpp
+3-2libc/src/sys/wait/linux/wait.cpp
+75-1121 files not shown
+78-1127 files

LLVM/project c490047flang/include/flang/Optimizer/Support Utils.h, flang/include/flang/Optimizer/Transforms DebugTypeGenerator.h

[flang][NFC] Move DebugTypeGenerator.h to the public include directory (#218544)

DebugTypeGenerator converts FIR/MLIR types to DITypeAttr, but its header
lives next to the pass that uses it, so it cannot be reused by passes
outside flang/lib/Optimizer/Transforms.

Move it to flang/include/flang/Optimizer/Transforms/ alongside the other
public headers, so other consumers can reuse the conversion.

The header's file-static getLineFromLoc is moved to
Optimizer/Support/Utils.h as an fir:: helper.
DeltaFile
+0-177flang/lib/Optimizer/Transforms/DebugTypeGenerator.h
+170-0flang/include/flang/Optimizer/Transforms/DebugTypeGenerator.h
+9-9flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+9-0flang/include/flang/Optimizer/Support/Utils.h
+1-1flang/lib/Optimizer/Transforms/DebugTypeGenerator.cpp
+189-1875 files

LLVM/project 4fc585fllvm/test/CodeGen/AMDGPU global-atomicrmw-fadd.ll amdgcn.bitcast.128bit.ll, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-llvm.amdgcn.image.sample.a16.ll

calling conv update
DeltaFile
+4,190-4,346llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+2,769-2,019llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.256bit.ll
+1,592-1,625llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+748-1,428llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+1,308-842llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.128bit.ll
+1,248-856llvm/test/CodeGen/AMDGPU/global-atomicrmw-fadd.ll
+11,855-11,116174 files not shown
+32,519-25,134180 files

LLVM/project fe6a3afclang/test/CodeGenOpenCL builtins-amdgcn-make-buffer-rsrc.cl, llvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp

[AMDGPU] Canonicalize num_records to its actual width in InstCombine

llvm.amdgcn.make.buffer.rsrc is overloaded on the type of its
num_records argument, but the hardware field it ends up in has a fixed
width (32 bits, or 45 bits on gfx1250 and up). Rewrite the intrinsic to
use that width, zero-extending or truncating num_records as needed, so
that IR-level optimizations can see that the extra bits of, for example,
the i64 that Clang emits are not demanded.

Targets that aren't concrete enough for the buffer resource layout to be
known are left alone.

AI disclosure: This was my idea but Claude wrote the code (and I've
tried to tighten up the comments)
DeltaFile
+36-44clang/test/CodeGenOpenCL/builtins-amdgcn-make-buffer-rsrc.cl
+27-27llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll
+22-12llvm/test/Transforms/InstCombine/AMDGPU/make-buffer-rsrc-num-records.ll
+21-1llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+106-844 files

LLVM/project 315c575llvm/test/Transforms/InstCombine/AMDGPU make-buffer-rsrc-num-records.ll

[AMDGPU] Pre-commit tests for num_records canonicalization

Add tests for having InstCombine canonicalize the num_records argument
of llvm.amdgcn.make.buffer.rsrc to the width it will ultimately have,
which lets later passes see that, for example, the high bits of the i64
that Clang emits aren't used.

AI disclosure: Claude generated these and I've looked at them
DeltaFile
+153-0llvm/test/Transforms/InstCombine/AMDGPU/make-buffer-rsrc-num-records.ll
+153-01 files

LLVM/project c03943dllvm/test/Transforms/InstCombine/AMDGPU make-buffer-rsrc-num-records.ll

Clean up triples
DeltaFile
+3-3llvm/test/Transforms/InstCombine/AMDGPU/make-buffer-rsrc-num-records.ll
+3-31 files

LLVM/project 6e2f9b1mlir/lib/Conversion/AMDGPUToROCDL AMDGPUToROCDL.cpp, mlir/test/Conversion/AMDGPUToROCDL amdgpu-to-rocdl.mlir

[mlir][AMDGPU] Emit num_records at the buffer resource's actual width

makeBufferRsrc() zero-extended num_records to i64 on targets whose
buffer resource has a 45-bit num_records field, leaving 19 bits that the
hardware will never look at. Emit an i45 instead, which is what
rocdl.make.buffer.rsrc will end up putting in the descriptor anyway, so
that downstream consumers can see that those bits aren't demanded.

While here, factor the i32 and i64 conversion helpers into a shared
convertUnsignedToInt() that takes the target width.

AI disclosure: Claude made this, I looked at and poked the design into
shape.
DeltaFile
+50-25mlir/test/Conversion/AMDGPUToROCDL/amdgpu-to-rocdl.mlir
+18-19mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp
+68-442 files

LLVM/project d996ce7llvm/lib/Target/AMDGPU AMDGPULowerBufferFatPointers.cpp, llvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-num-records-width.ll

[AMDGPU] Use real num_records width in LowerBufferFatPointers

Fix the following edge cases in reasoning about whether a value can be
The out-of-bounds analysis in LowerBufferFatPointers took the
num_records operand of llvm.amdgcn.make.buffer.rsrc at face value, which
went wrong in three ways.

1. The pass would crash if num_records was narrower than the
underlying hardware width.
2. A 45-bit num_records with its high bit set made all offsets look
negative, which, among other things, broke the `(1 << 45) - 1` "no
bounds checking" value.
3. The test for all-1 num_records wasn't accounting for hardware
width, leading to false positives if the num_records field was
narrower tan the underlying field.
4. Don't try to do reasoning about num_records when its width isn't
known.

AI disclosure: Claude found and took a try at fixing these, I've
reviewed
DeltaFile
+199-59llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-num-records-width.ll
+19-13llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
+218-722 files

LLVM/project f7258eallvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-num-records-width.ll

Update generic target to something better
DeltaFile
+1-1llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-num-records-width.ll
+1-11 files

LLVM/project 9dd5690llvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-num-records-width.ll

Update test explanations
DeltaFile
+5-7llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-num-records-width.ll
+5-71 files

LLVM/project 8c98f8dllvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-num-records-width.ll

[AMDGPU] Pre-commit num_records of arbitrary width tests for LowerBufferFatPointers

Add tests to ensure that the reasoning for whether an access can be
partially out of bounds and needs to be scalarized work correctly when
num_records has a width different from the hardware width.

AI disclosure: Claude generated these and I've looked at them
DeltaFile
+236-0llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-num-records-width.ll
+236-01 files

LLVM/project 0f45834llvm/lib/Target/AMDGPU GCNSubtarget.h

Fix typo

Co-authored-by: Lukas Sommer <lukas.sommer at amd.com>
DeltaFile
+1-1llvm/lib/Target/AMDGPU/GCNSubtarget.h
+1-11 files

LLVM/project 048ff2bllvm/lib/Target/AMDGPU SIISelLowering.cpp AMDGPULowerBufferFatPointers.cpp

[AMDGPU] Track buffer resource num_records width in a subtarget field

Replace the boolean 45-bit-num-records-buffer-resource subtarget
feature's `Has45BitNumRecordsBufferResource` flag with a numeric
`BufferResourceNumRecordsWidth` field.

AI disclosure: Code by Claude, comments and wordings by me
DeltaFile
+24-12llvm/lib/Target/AMDGPU/AMDGPU.td
+13-0llvm/lib/Target/AMDGPU/GCNSubtarget.h
+1-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+40-155 files

LLVM/project ab896c6clang/lib/Sema SemaTemplateDeduction.cpp SemaConcept.cpp, clang/test/CXX/temp/temp.constr/temp.constr.atomic constrant-satisfaction-conversions.cpp

[Clang] Improve concept diagnostics (#218618)

We used to drop SFINAE errors that occurred during parameter mapping
instantiation
on the floor, making our diagnostics worse for some cases.

This patch corrects that behavior. Moreover it fixes some clients where
the errors were not properly handled for invalid expressions.

Fixes https://github.com/llvm/llvm-project/issues/144053
DeltaFile
+49-62clang/lib/Sema/SemaConcept.cpp
+48-15clang/test/SemaCXX/cxx2c-fold-exprs.cpp
+26-0clang/test/SemaTemplate/concepts.cpp
+4-7clang/lib/Sema/SemaTemplateDeduction.cpp
+4-1clang/test/SemaTemplate/cxx2a-constraint-exprs.cpp
+4-0clang/test/CXX/temp/temp.constr/temp.constr.atomic/constrant-satisfaction-conversions.cpp
+135-859 files not shown
+151-8915 files

LLVM/project f67f89bclang/test/CodeGenOpenCL builtins-amdgcn-make-buffer-rsrc.cl, llvm/lib/Target/AMDGPU AMDGPUInstCombineIntrinsic.cpp

[AMDGPU] Canonicalize num_records to its actual width in InstCombine

llvm.amdgcn.make.buffer.rsrc is overloaded on the type of its
num_records argument, but the hardware field it ends up in has a fixed
width (32 bits, or 45 bits on gfx1250 and up). Rewrite the intrinsic to
use that width, zero-extending or truncating num_records as needed, so
that IR-level optimizations can see that the extra bits of, for example,
the i64 that Clang emits are not demanded.

Targets that aren't concrete enough for the buffer resource layout to be
known are left alone.

AI disclosure: This was my idea but Claude wrote the code (and I've
tried to tighten up the comments)
DeltaFile
+36-44clang/test/CodeGenOpenCL/builtins-amdgcn-make-buffer-rsrc.cl
+27-27llvm/test/Transforms/InstCombine/AMDGPU/amdgcn-intrinsics.ll
+22-12llvm/test/Transforms/InstCombine/AMDGPU/make-buffer-rsrc-num-records.ll
+21-1llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp
+106-844 files

LLVM/project 3753c71llvm/test/Transforms/InstCombine/AMDGPU make-buffer-rsrc-num-records.ll

Clean up triples
DeltaFile
+3-3llvm/test/Transforms/InstCombine/AMDGPU/make-buffer-rsrc-num-records.ll
+3-31 files

LLVM/project 2d63213llvm/test/Transforms/InstCombine/AMDGPU make-buffer-rsrc-num-records.ll

[AMDGPU] Pre-commit tests for num_records canonicalization

Add tests for having InstCombine canonicalize the num_records argument
of llvm.amdgcn.make.buffer.rsrc to the width it will ultimately have,
which lets later passes see that, for example, the high bits of the i64
that Clang emits aren't used.

AI disclosure: Claude generated these and I've looked at them
DeltaFile
+153-0llvm/test/Transforms/InstCombine/AMDGPU/make-buffer-rsrc-num-records.ll
+153-01 files

LLVM/project 861a0f7llvm/lib/Target/AMDGPU AMDGPULowerBufferFatPointers.cpp, llvm/test/CodeGen/AMDGPU lower-buffer-fat-pointers-num-records-width.ll

[AMDGPU] Use real num_records width in LowerBufferFatPointers

Fix the following edge cases in reasoning about whether a value can be
The out-of-bounds analysis in LowerBufferFatPointers took the
num_records operand of llvm.amdgcn.make.buffer.rsrc at face value, which
went wrong in three ways.

1. The pass would crash if num_records was narrower than the
underlying hardware width.
2. A 45-bit num_records with its high bit set made all offsets look
negative, which, among other things, broke the `(1 << 45) - 1` "no
bounds checking" value.
3. The test for all-1 num_records wasn't accounting for hardware
width, leading to false positives if the num_records field was
narrower tan the underlying field.
4. Don't try to do reasoning about num_records when its width isn't
known.

AI disclosure: Claude found and took a try at fixing these, I've
reviewed
DeltaFile
+199-59llvm/test/CodeGen/AMDGPU/lower-buffer-fat-pointers-num-records-width.ll
+19-13llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp
+218-722 files