LLVM/project e692a3d — llvm/lib/Target/AMDGPU GCNHazardRecognizer.cpp, llvm/test/CodeGen/AMDGPU fdiv.bf16.ll llvm.log2.bf16.ll

[AMDGPU] Mitigate TRANS f16 to partial VGPR write WAW hazard

Fixes: ROCM-33929
DeltaFile
+226-0llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write.mir
+170-0llvm/test/CodeGen/AMDGPU/hazard-partial-trans-f16-write-fake16.mir
+101-0llvm/lib/Target/AMDGPU/GCNHazardRecognizer.cpp
+29-16llvm/test/CodeGen/AMDGPU/llvm.exp2.bf16.ll
+24-13llvm/test/CodeGen/AMDGPU/llvm.log2.bf16.ll
+10-7llvm/test/CodeGen/AMDGPU/fdiv.bf16.ll
+560-365 files not shown
+577-4011 files

LLVM/project 51f2919 — flang-rt/lib/runtime edit-input.cpp, flang-rt/test/Driver boz-input-field.f90

[flang-rt] Consume the whole field in B/O/Z input (#238057)

EditBOZInput reads a fixed-width field twice: the first pass counts the
significant digits, then it rewinds to the first significant digit and
the second pass decodes exactly that many digits. Nothing moved the
position back to the end of the field afterwards, so the next edit
descriptor started reading right after the last significant digit:
    
      s = '1F    XY'; read (s, '(z6,a2)') i, c   ! c was '  ', not 'XY'
      s = '1f,2';     read (s, '(z4,i2)') i, j   ! j was 0, not 2
    
The second pass also called GotChar() again for each character it
re-read, so READ(SIZE=) counted the significant digits twice (8 instead
of 6 for '(z6)' on '  1F  ').
    
Record the position reached at the end of the first pass, which is past
any trailing blanks and any separator that ended the field early, and
return to it after decoding. Undo the SIZE= count of the re-read
characters.

    [8 lines not shown]
DeltaFile
+94-0flang-rt/test/Driver/boz-input-field.f90
+29-0flang-rt/unittests/Runtime/InputExtensions.cpp
+12-0flang-rt/lib/runtime/edit-input.cpp
+6-0flang/docs/Extensions.md
+141-04 files

LLVM/project 3321830 — llvm/test/tools/dsymutil/AArch64 relocatable-dwarf.test, llvm/test/tools/dsymutil/X86/DWARFLinkerParallel odr-template-parameters.test odr-parents.test

[dsymutil] Ignore relocations into DWARF sections  (#242508)

With relocatable DWARF on Mach-O, a relocation from one DWARF section
into another holds an offset into the target section. dsymutil looked
these up in the debug map as object addresses, so an offset that
happened to equal a symbol's address was overwritten with that symbol's
linked address, breaking DW_FORM_ref_addr references.

Skip relocations whose target is a __DWARF section.

Four parallel-linker ODR tests depended on the old behavior. Their
hand-written objects carry a relocation into __debug_abbrev that exists
only so dsymutil sees a valid relocation and links the object; it
resolved to the debug-map symbol by accident. Make it an extern
relocation against that symbol instead.

rdar://192719765
Assisted-by: Claude
DeltaFile
+135-0llvm/test/tools/dsymutil/AArch64/relocatable-dwarf.test
+11-0llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+2-2llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/odr-template-parameters.test
+2-2llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/odr-parents.test
+2-2llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/odr-namespace-extension.test
+2-2llvm/test/tools/dsymutil/X86/DWARFLinkerParallel/odr-fwd-declaration3.test
+154-86 files

LLVM/project 46dac42 — llvm/test/tools/llvm-diff compare-aliasing-metadata.ll, llvm/tools/llvm-diff/lib DiffConsumer.h DifferenceEngine.cpp

Revert "[llvm-diff] Compare TBAA and alias scope metadata (#238976)"

This reverts commit e5b070e81126cf4aefa9965e54199a42211c2e5e.
DeltaFile
+0-200llvm/test/tools/llvm-diff/compare-aliasing-metadata.ll
+1-120llvm/tools/llvm-diff/lib/DiffConsumer.cpp
+1-7llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
+0-3llvm/tools/llvm-diff/lib/DiffConsumer.h
+2-3304 files

LLVM/project 5fe68f2 — llvm/lib/Remarks BitstreamRemarkParser.cpp, llvm/unittests/Remarks BitstreamRemarksParsingTest.cpp

[Remarks] Return the error when the bitstream parser cannot enter a block (#242616)

`BitstreamBlockParserHelperBase::enterBlock` tested the `Error` from
`BitstreamCursor::EnterSubBlock` as a boolean and never consumed it. A
container that ends right after a block header makes `EnterSubBlock`
fail, and a build with `LLVM_ENABLE_ABI_BREAKING_CHECKS` then aborts
with "Program aborted due to an unhandled Error" instead of reporting a
parse error.

`enterBlock` now returns the error from `EnterSubBlock`, as the other
bitstream readers do. The new test cuts a container written by the
serializer after every 32-bit word and expects each prefix to fail.
Without the fix it aborts in a build with ABI-breaking checks.

Assisted-by: Claude Code (Claude Fable 5.2)
DeltaFile
+28-2llvm/unittests/Remarks/BitstreamRemarksParsingTest.cpp
+1-3llvm/lib/Remarks/BitstreamRemarkParser.cpp
+29-52 files

LLVM/project a2ec76d — clang/lib/CodeGen CGExprCXX.cpp, clang/test/CodeGenCXX new_hot_cold.cpp

CGExprCXX: emit family and allockind attributes

This allows us to remove the special knowledge about C++ allocation from
LLVM's MemoryBuiltins.cpp, instead trusting attributes to communicate
the important properties.

Annoyingly, clang has to grow a little bit of hard-coded knowledge about
mangled symbol names in order to actually get the most-basic-matching
::operator::new when working out the alloc-family attribute. I spent
some time trying to do this "right" by looking up the available
operators new and finding the best one, but that's super tricky and this
has the virtue of working and being pretty obviously correct when
compared to the old code.

Happily, clang now emits allocator family attributes for custom
allocators like the `__hot_cold_t` overloads in `new_hot_cold.cpp`
(which `isReplaceableGlobalAllocationFunction` in clang recognizes),
allowing us to remove that special knowledge from LLVM.


    [7 lines not shown]
DeltaFile
+2-120llvm/lib/Analysis/MemoryBuiltins.cpp
+51-51llvm/test/Transforms/InstCombine/new-delete-itanium.ll
+51-3clang/lib/CodeGen/CGExprCXX.cpp
+10-22clang/test/Headers/openmp_new_nothrow.cpp
+14-14llvm/test/Transforms/InstCombine/new-delete-itanium-32.ll
+16-10clang/test/CodeGenCXX/new_hot_cold.cpp
+144-22017 files not shown
+177-25023 files

LLVM/project c9b4915 — clang/lib/CodeGen CGCall.cpp, clang/test/CodeGen alloc-align-attr.c catch-alignment-assumption-attribute-alloc_align-on-function.cpp

clang: emit allocalign to LLVM for alloc_align attributes

LLVM is growing knowledge of this, so we should inform it when we have
the information available. As a bonus, since we now check return
alignments in the callee as of an earlier patch of mine, we can now drop
the redundant llvm.assume() that this previously emitted.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the
limit of my abilities (I don't do much in LLVM, and this is my first
time touching clang in a meaningful way) and they appear sensible. The
commit messages are entirely written by me.

Differential Revision: https://reviews.llvm.org/D119271
DeltaFile
+14-85clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+7-36clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+24-2clang/lib/CodeGen/CGCall.cpp
+6-16clang/test/CodeGen/alloc-align-attr.c
+8-8clang/test/CodeGenCXX/new_hot_cold.cpp
+6-6clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
+65-1539 files not shown
+80-18115 files

LLVM/project f1decc4 — llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine simplify-libcalls-new.ll

SimplifyLibCalls: preserve allocation attributes in optimizeNew

When `LibCallSimplifier::optimizeNew` rewrites an `operator new` call into a
`__hot_cold_t` allocation call, forward the allocation attributes
(`allockind`, `allocsize`, `"alloc-family"`, and parameter `allocalign`) from
the original call onto the synthesized call instruction alongside its metadata.

This is a new patch since 2023 (unlike most of the rest of the stack)
and allows the next patch to remove more specialized C++ knowledge
from the LLVM layer, instead leaving it in clang where it seems more
sensible.

This patch was authored with the assistance of an LLM and was reviewed
by me before posting.
DeltaFile
+10-1llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+1-1llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
+11-22 files

LLVM/project 5f6e9ab — clang/lib/CodeGen CodeGenFunction.cpp, clang/test/CodeGen catch-alignment-assumption-attribute-assume_aligned-on-function.cpp catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp

clang: also check alloc_align and assume_aligned claims in return

Prior to this patch, we only check alloc_align and assume_aligned claims
in the caller. We are about to thread alloc_align information down into
LLVM, which would then have a chance to defeat the sanitizer checks by
performing optimizations. To avoid that, we also check alignment claims
in the called function prior to return.

Per review feedback on D121629:
- Also verify the alignment required by `AssumeAlignedAttr` in
  `EmitReturnValueCheck`.
- Add a new `ReturnAlignmentAssumption` (`return_alignment_assumption`)
  sanitizer handler in clang and compiler-rt that accepts the dynamic
  return statement `SourceLocation` pointer loaded from `ReturnLocation`.
- Only emit the sanitizer check (and not a redundant `llvm.assume`) in
  `EmitReturnValueCheck`.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the

    [5 lines not shown]
DeltaFile
+90-15clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+90-15clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+82-13clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
+79-13clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
+51-18clang/lib/CodeGen/CodeGenFunction.cpp
+46-10compiler-rt/lib/ubsan/ubsan_handlers.cpp
+438-8411 files not shown
+504-8817 files

LLVM/project 5f664f9 — clang/lib/CodeGen CodeGenFunction.h CodeGenFunction.cpp

[NFC] clang: simplify emitAlignmentAssumptionCheck

Move the alignment check condition (`ptrtoint`, optional offset subtraction,
mask, and `icmp eq 0`) into `CodeGenFunction::emitAlignmentAssumptionCheck`
and emit the sanitizer check before `Builder.CreateAlignmentAssumption`.

This removes the need to pass `TheCheck` and `Assumption` into
`emitAlignmentAssumptionCheck` (or temporarily unlink and re-insert
`Assumption`) and prepares `emitAlignmentAssumptionCheck` to be called
directly without an accompanying `@llvm.assume`.

This patch is new since this line of work was originally authored in
2023. It was largely written by an LLM in response to review feedback
for the next patch, but I hand-reviewed the content and it looks
reasonable enough (with the same disclaimer as other patches that I
know nothing about clang.)
DeltaFile
+47-64clang/lib/CodeGen/CodeGenFunction.cpp
+1-3clang/lib/CodeGen/CodeGenFunction.h
+48-672 files

LLVM/project 017598d — clang/test/CodeGen catch-alignment-assumption-attribute-alloc_align-on-function.cpp catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp

CodeGen: hand assume_aligned tests to the care of update_cc_test_checks (#239726)

My previous change already landed upstream for the two alloc_align
tests. Since a later patch's review feedback requested also checking
AssumeAlignedAttr in EmitReturnValueCheck, convert the two corresponding
assume_aligned tests (and refresh the alloc_align tests) using
update_cc_test_checks.py first so that the functional changes in the
next patch are obvious.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the limit
of my abilities (I don't do much in LLVM, and this is my first time
touching clang in a meaningful way) and they appear sensible. The commit
messages are entirely written by me.

Differential Revision: https://reviews.llvm.org/D152400
DeltaFile
+84-35clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
+79-34clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
+25-12clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+11-11clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+199-924 files

LLVM/project ec4bf63 — lld/MachO InputFiles.h

[lld][MachO][NFC] Make DylibFile::numReferencedSymbols atomic (#243209)

This is part of the ld64.lld performance improvements tracked by #222068
and #238939.

Referencing/unreferencing symbols from the same dylib needs to be thread
safe for parallel sharded symbol-table insertion.
DeltaFile
+2-1lld/MachO/InputFiles.h
+2-11 files

LLVM/project 4040ef3 — lld/test/MachO objc-category-conflicts.s

fix test
DeltaFile
+1-1lld/test/MachO/objc-category-conflicts.s
+1-11 files

LLVM/project 8368688 — clang/lib/CIR/CodeGen CIRGenVTables.cpp, clang/test/CIR/CodeGen vtt.cpp multi-vtable.cpp

[CIR] Mark vtables unnamed_addr when their address is insignificant (#239708)

Port classic codegen's vtable unnamed_addr rules to CIR:  
* A vtable is marked unnamed_addr when no RTTI is emitted, since nothing
(e.g. dynamic_cast) relies on its address.
* On targets that may duplicate weak vtables, a weak vtable is marked
unnamed_addr even with RTTI.

AI help was used for this PR description and the commit itself.
Especially in testing.

---------

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+68-0clang/test/CIR/CodeGenCXX/vtable-unnamed-addr.cpp
+10-10clang/test/CIR/CodeGen/thunks.cpp
+11-4clang/lib/CIR/CodeGen/CIRGenVTables.cpp
+6-6clang/test/CIR/CodeGen/multi-vtable.cpp
+6-3clang/test/CIR/CodeGen/vtt.cpp
+4-4clang/test/CIR/CodeGenCXX/vtable-pure-deleted-funcs.cpp
+105-277 files not shown
+120-3213 files

LLVM/project 786b0aa — llvm/test/Transforms/SLPVectorizer/AArch64 fma-copyable-passthrough-lane.ll, llvm/test/Transforms/SLPVectorizer/X86 copyable-fma-addend-blend.ll copyable-fp-identity-exact.ll

[SLP][NFC]Add tests for incorrect copyables for FP, NFC

Pull-request: https://github.com/llvm/llvm-project/pull/243230
DeltaFile
+413-0llvm/test/Transforms/SLPVectorizer/X86/copyable-fp-identity-exact.ll
+40-0llvm/test/Transforms/SLPVectorizer/X86/copyable-fma-addend-blend.ll
+22-0llvm/test/Transforms/SLPVectorizer/AArch64/fma-copyable-passthrough-lane.ll
+475-03 files

LLVM/project 6f89d0e — llvm/lib/Target/SystemZ/MCTargetDesc SystemZHLASMAsmStreamer.cpp, llvm/test/CodeGen/SystemZ zos-ppa1-name.ll zos-ppa2.ll

[SystemZ][z/OS] Emit printable string data as CE/CA constants in HLASM

The HLASM streamer emitted every emitBytes() payload as hex (DC XL),
which made z/OS string data hard to read in the generated assembly.
MCAsmStreamer already distinguishes printable strings from binary data.

Mirror that behavior in SystemZHLASMAsmStreamer::emitBytes(). Each
chunk is classified as follows:

  - If it is printable EBCDIC-1047 text (checked after converting it to
    ASCII with ConverterEBCDIC::convertToUTF8), emit DC CE'...' using the
    converted text.
  - Otherwise, if it is printable ASCII, emit DC CA'...'.
  - Otherwise, fall back to DC XL<n>'...'.

Apostrophes and ampersands inside the quoted text are doubled, as
emitALIAS() already does, so HLASM does not treat them as delimiters or
variable substitutions.


    [18 lines not shown]
DeltaFile
+39-1llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp
+22-0llvm/test/CodeGen/SystemZ/zos-hlasm-char-const.ll
+3-12llvm/test/CodeGen/SystemZ/zos-hlasm-dc-xl.ll
+3-3llvm/test/CodeGen/SystemZ/zos-ppa2.ll
+3-3llvm/test/CodeGen/SystemZ/zos-ppa1.ll
+1-1llvm/test/CodeGen/SystemZ/zos-ppa1-name.ll
+71-203 files not shown
+74-229 files

LLVM/project 00b877d — llvm/lib/Transforms/Vectorize VPlanRecipes.cpp VPlan.h

[VPlan] Share the result-type helper of `VPReplicateRecipe` with `VPWidenRecipe` (NFC)
DeltaFile
+28-20llvm/lib/Transforms/Vectorize/VPlan.h
+2-2llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+30-222 files

LLVM/project bc33800 — llvm/lib/Transforms/Vectorize VPlanUtils.cpp LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize outer-loop-bitinsert-bitextract.ll bitinsert-bitextract.ll

[LV] Widen `bitinsert` and `bitextract`
DeltaFile
+782-0llvm/test/Transforms/LoopVectorize/bitinsert-bitextract.ll
+337-0llvm/test/Transforms/LoopVectorize/X86/bitinsert-bitextract-cost.ll
+174-0llvm/test/Transforms/LoopVectorize/outer-loop-bitinsert-bitextract.ll
+42-1llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp
+4-0llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+2-0llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+1,341-16 files

LLVM/project 5af1c69 — llvm/include/llvm/Analysis TargetTransformInfoImpl.h TargetTransformInfo.h, llvm/include/llvm/CodeGen BasicTTIImpl.h

[TTI] Drop default args from `bitinsert`/`bitextract` costs
DeltaFile
+14-14llvm/include/llvm/Analysis/TargetTransformInfo.h
+10-10llvm/include/llvm/CodeGen/BasicTTIImpl.h
+10-10llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
+34-343 files

LLVM/project 8a7f86f — llvm/lib/Target/AArch64 AArch64InstrInfo.cpp, llvm/test/CodeGen/AArch64 machine-outliner-retaddr-sign-regsave.mir machine-outliner-retaddr-sign-thunk.ll

[AArch64][MachineOutliner] Allow calls to be outlined when PAC is enabled (#230840)

This patch allows call sequences to be outlined when PAC-RET is active
by relaxing the stack pointer modification check for valid thunk
candidates.

Direct calls outlined as thunks are safe because the return address is
signed in the prologue and authenticated in the epilogue, while
candidates with intermediate calls that would clobber LR are still
rejected.

Fixes #230519.

> **Note on scope:** This patch specifically addresses direct and tail
calls. Indirect calls (`BLR`) under `-mbranch-protection=standard`
interact with existing BTI (`branch-target-enforcement`) constraints and
will be addressed in a follow-up patch.
DeltaFile
+141-12llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-sp-mod.ll
+65-59llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
+106-0llvm/test/CodeGen/AArch64/machine-outliner-pac-tail-call.ll
+54-27llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-cfi.ll
+10-44llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-thunk.ll
+0-10llvm/test/CodeGen/AArch64/machine-outliner-retaddr-sign-regsave.mir
+376-1526 files

LLVM/project 918b710 — clang/lib/CIR/CodeGen CIRGenBuiltin.cpp CIRGenBuiltinNVPTX.cpp, clang/test/CIR/CodeGenCUDA builtins-nvptx-wmma-errors.cu builtins-nvptx-wmma-load-errors.cu

[CIR][NVPTX] Support WMMA fragment loads (#234812)

Emit CIR for all 47 WMMA fragment-load builtins. Marshal scalar and
aggregate fragments through NVVM load intrinsics, preserving packed-half
representations and selecting row/column layout variants.

Add CIR and shared classic/CIR LLVM checks for all 88 supported
load/layout combinations, plus target-feature and invalid-argument
diagnostics.

Validation: 40 relevant lit tests pass. A clean assertion-enabled
compiler build and LLVM IR verification succeed. SM70/SM80 PTX
generation succeeds, with all 88 load instruction mnemonics matching
classic codegen. All 18 scalar cases directly store the intrinsic
result.

Related: https://github.com/llvm/llvm-project/issues/179278

Assisted-by: OpenAI Codex
DeltaFile
+758-0clang/test/CIR/CodeGenCUDA/builtins-nvptx-wmma-loads.cu
+208-0clang/test/CIR/CodeGenCUDA/builtins-nvptx-wmma.cu
+182-21clang/lib/CIR/CodeGen/CIRGenBuiltinNVPTX.cpp
+141-0clang/test/CIR/CodeGenCUDA/builtins-nvptx-wmma-load-errors.cu
+34-0clang/test/CIR/CodeGenCUDA/builtins-nvptx-wmma-errors.cu
+7-0clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp
+1,330-216 files

LLVM/project b7c3e01 — mlir/include/mlir-c Remarks.h, mlir/lib/Bindings/Python IRRemarks.cpp

[mlir] Expose related remark IDs in C and Python (#243010)
DeltaFile
+33-0mlir/test/python/ir/remarks.py
+14-0mlir/test/CAPI/remarks.c
+12-0mlir/test/python/lib/PythonTestCAPI.cpp
+11-0mlir/lib/CAPI/IR/Remarks.cpp
+11-0mlir/lib/Bindings/Python/IRRemarks.cpp
+7-0mlir/include/mlir-c/Remarks.h
+88-03 files not shown
+93-09 files

LLVM/project db286ad — clang/lib/CodeGen CGExprCXX.cpp, clang/test/CodeGenCXX new_hot_cold.cpp

CGExprCXX: emit family and allockind attributes

This allows us to remove the special knowledge about C++ allocation from
LLVM's MemoryBuiltins.cpp, instead trusting attributes to communicate
the important properties.

Annoyingly, clang has to grow a little bit of hard-coded knowledge about
mangled symbol names in order to actually get the most-basic-matching
::operator::new when working out the alloc-family attribute. I spent
some time trying to do this "right" by looking up the available
operators new and finding the best one, but that's super tricky and this
has the virtue of working and being pretty obviously correct when
compared to the old code.

Happily, clang now emits allocator family attributes for custom
allocators like the `__hot_cold_t` overloads in `new_hot_cold.cpp`
(which `isReplaceableGlobalAllocationFunction` in clang recognizes),
allowing us to remove that special knowledge from LLVM.


    [7 lines not shown]
DeltaFile
+2-120llvm/lib/Analysis/MemoryBuiltins.cpp
+51-51llvm/test/Transforms/InstCombine/new-delete-itanium.ll
+51-3clang/lib/CodeGen/CGExprCXX.cpp
+10-22clang/test/Headers/openmp_new_nothrow.cpp
+14-14llvm/test/Transforms/InstCombine/new-delete-itanium-32.ll
+16-10clang/test/CodeGenCXX/new_hot_cold.cpp
+144-22017 files not shown
+177-25023 files

LLVM/project 2fb23be — clang/test/CodeGen catch-alignment-assumption-attribute-alloc_align-on-function.cpp catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp

CodeGen: hand assume_aligned tests to the care of update_cc_test_checks

My previous change already landed upstream for the two alloc_align
tests. Since a later patch's review feedback requested also checking
AssumeAlignedAttr in EmitReturnValueCheck, convert the two
corresponding assume_aligned tests (and refresh the alloc_align tests)
using update_cc_test_checks.py first so that the functional changes in
the next patch are obvious.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the
limit of my abilities (I don't do much in LLVM, and this is my first
time touching clang in a meaningful way) and they appear sensible. The
commit messages are entirely written by me.

Differential Revision: https://reviews.llvm.org/D152400
DeltaFile
+84-35clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
+79-34clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
+25-12clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+11-11clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+199-924 files

LLVM/project ed20fb0 — clang/lib/CodeGen CodeGenFunction.cpp, clang/test/CodeGen catch-alignment-assumption-attribute-assume_aligned-on-function.cpp catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp

clang: also check alloc_align and assume_aligned claims in return

Prior to this patch, we only check alloc_align and assume_aligned claims
in the caller. We are about to thread alloc_align information down into
LLVM, which would then have a chance to defeat the sanitizer checks by
performing optimizations. To avoid that, we also check alignment claims
in the called function prior to return.

Per review feedback on D121629:
- Also verify the alignment required by `AssumeAlignedAttr` in
  `EmitReturnValueCheck`.
- Add a new `ReturnAlignmentAssumption` (`return_alignment_assumption`)
  sanitizer handler in clang and compiler-rt that accepts the dynamic
  return statement `SourceLocation` pointer loaded from `ReturnLocation`.
- Only emit the sanitizer check (and not a redundant `llvm.assume`) in
  `EmitReturnValueCheck`.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the

    [5 lines not shown]
DeltaFile
+90-15clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+90-15clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+82-13clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function-two-params.cpp
+79-13clang/test/CodeGen/catch-alignment-assumption-attribute-assume_aligned-on-function.cpp
+51-18clang/lib/CodeGen/CodeGenFunction.cpp
+46-10compiler-rt/lib/ubsan/ubsan_handlers.cpp
+438-8411 files not shown
+504-8817 files

LLVM/project 04bb35c — llvm/lib/Transforms/Utils SimplifyLibCalls.cpp, llvm/test/Transforms/InstCombine simplify-libcalls-new.ll

SimplifyLibCalls: preserve allocation attributes in optimizeNew

When `LibCallSimplifier::optimizeNew` rewrites an `operator new` call into a
`__hot_cold_t` allocation call, forward the allocation attributes
(`allockind`, `allocsize`, `"alloc-family"`, and parameter `allocalign`) from
the original call onto the synthesized call instruction alongside its metadata.

This is a new patch since 2023 (unlike most of the rest of the stack)
and allows the next patch to remove more specialized C++ knowledge
from the LLVM layer, instead leaving it in clang where it seems more
sensible.

This patch was authored with the assistance of an LLM and was reviewed
by me before posting.
DeltaFile
+10-1llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+1-1llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
+11-22 files

LLVM/project 165e4ef — clang/lib/CodeGen CGCall.cpp, clang/test/CodeGen alloc-align-attr.c catch-alignment-assumption-attribute-alloc_align-on-function.cpp

clang: emit allocalign to LLVM for alloc_align attributes

LLVM is growing knowledge of this, so we should inform it when we have
the information available. As a bonus, since we now check return
alignments in the callee as of an earlier patch of mine, we can now drop
the redundant llvm.assume() that this previously emitted.

This patch is originally from 2023 and was rebased and revised with
assistance from an LLM. I have manually reviewed the diffs to the
limit of my abilities (I don't do much in LLVM, and this is my first
time touching clang in a meaningful way) and they appear sensible. The
commit messages are entirely written by me.

Differential Revision: https://reviews.llvm.org/D119271
DeltaFile
+14-85clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function-variable.cpp
+7-36clang/test/CodeGen/catch-alignment-assumption-attribute-alloc_align-on-function.cpp
+24-2clang/lib/CodeGen/CGCall.cpp
+6-16clang/test/CodeGen/alloc-align-attr.c
+8-8clang/test/CodeGenCXX/new_hot_cold.cpp
+6-6clang/test/CodeGenCXX/cxx1z-aligned-allocation.cpp
+65-1539 files not shown
+80-18115 files

LLVM/project 30e2ff7 — clang/lib/CodeGen CodeGenFunction.h CodeGenFunction.cpp

[NFC] clang: simplify emitAlignmentAssumptionCheck

Move the alignment check condition (`ptrtoint`, optional offset subtraction,
mask, and `icmp eq 0`) into `CodeGenFunction::emitAlignmentAssumptionCheck`
and emit the sanitizer check before `Builder.CreateAlignmentAssumption`.

This removes the need to pass `TheCheck` and `Assumption` into
`emitAlignmentAssumptionCheck` (or temporarily unlink and re-insert
`Assumption`) and prepares `emitAlignmentAssumptionCheck` to be called
directly without an accompanying `@llvm.assume`.

This patch is new since this line of work was originally authored in
2023. It was largely written by an LLM in response to review feedback
for the next patch, but I hand-reviewed the content and it looks
reasonable enough (with the same disclaimer as other patches that I
know nothing about clang.)
DeltaFile
+47-64clang/lib/CodeGen/CodeGenFunction.cpp
+1-3clang/lib/CodeGen/CodeGenFunction.h
+48-672 files

LLVM/project e5b070e — llvm/test/tools/llvm-diff compare-aliasing-metadata.ll, llvm/tools/llvm-diff/lib DiffConsumer.h DifferenceEngine.cpp

[llvm-diff] Compare TBAA and alias scope metadata (#238976)

Report instructions that differ in !tbaa, !tbaa.struct, !alias.scope or
!noalias.
Distinct nodes, such as alias scopes, are matched by structure. 
For a differing instruction, print the kinds of this metadata that
differ below it with the nested nodes expanded,
because the node numbers differ between modules. A kind is printed only
if a differing instruction with the same
opcode on the other side has different metadata of that kind, and none
has the same metadata.

AI-assisted.
DeltaFile
+200-0llvm/test/tools/llvm-diff/compare-aliasing-metadata.ll
+120-1llvm/tools/llvm-diff/lib/DiffConsumer.cpp
+7-1llvm/tools/llvm-diff/lib/DifferenceEngine.cpp
+3-0llvm/tools/llvm-diff/lib/DiffConsumer.h
+330-24 files

LLVM/project 7c787ef — llvm/lib/Transforms/Scalar ConstraintElimination.cpp, llvm/test/Transforms/ConstraintElimination vector-with-overflow.ll add-nsw.ll

Reapply "[ConstraintElim] A signed sum of operands with opposite signs cannot …"

This reverts commit 0eaa3c85b2f5c7232016409ab968e752f8f09450.
DeltaFile
+110-0llvm/test/Transforms/ConstraintElimination/sadd-with-overflow.ll
+45-17llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+48-6llvm/test/Transforms/ConstraintElimination/add-nsw.ll
+1-3llvm/test/Transforms/ConstraintElimination/vector-with-overflow.ll
+204-264 files