LLVM/project 3540393 — llvm/lib/Transforms/Scalar LoopPredication.cpp, llvm/test/Transforms/LoopPredication assume-cache.ll

[LoopPredication] Register inserted assumptions with the AssumptionCache (#247964)

When widening a guard, LoopPredication inserts an llvm.assume of the
guard's old condition (on by default), but did not register it with the
AssumptionCache. The cache is never invalidated, so it was missing these
assumptions for the rest of the pipeline. This registers them in both
places that insert one.

Another follow-up to #245493.
DeltaFile
+74-0llvm/test/Transforms/LoopPredication/assume-cache.ll
+8-5llvm/lib/Transforms/Scalar/LoopPredication.cpp
+82-52 files

LLVM/project dfb992c — 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 83f8006 — 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 46656f9 — bolt/lib/Rewrite RewriteInstance.cpp, bolt/test/X86 ambiguous_fragment.test symbol-priority.test

[BOLT] Prefer global symbols at the same address (#244233)

Currently, BOLT's address-to-symbol resolution prioritizes function
symbols over other symbols and debug symbols, without making a
fine-grained distinction for local symbols. When multiple symbols share
the same address, BOLT may pick a local function symbol as the primary
name and emit it into the output binary and profile (this is especially
common on RISC-V due to the heavy use of label symbols). This can cause
confusion and potential profile mismatch issues (lots of `PG.` symbols
emitted, as described in #243760).

This patch standardizes the behavior of `discoverFileObjects()` and
refines the handling of local vs. global symbols, selecting the primary
symbol name according to the following priority order:
0: Global function
1: Non-global function
2: Other global symbol
3: Other non-global symbol
4: Global debug symbol
5: Non-global debug symbol
DeltaFile
+77-0bolt/test/X86/symbol-priority.test
+14-8bolt/lib/Rewrite/RewriteInstance.cpp
+2-2bolt/test/X86/ambiguous_fragment.test
+93-103 files

LLVM/project 738e2db — llvm/lib/Analysis InstructionSimplify.cpp, llvm/test/Transforms/InstSimplify icmp-monotonic.ll

[InstSimplify] Fold comparisons of ctpop with its operand (#221104)

Fold llvm.ctpop(x) <= x by registering x as an unsigned upper bound of
ctpop(x). Automatically handles other canonicalized variants.

Partially addresses #220800.

Alive2 proof https://alive2.llvm.org/ce/z/MTkIxk
DeltaFile
+86-0llvm/test/Transforms/InstSimplify/icmp-monotonic.ll
+3-1llvm/lib/Analysis/InstructionSimplify.cpp
+89-12 files

LLVM/project 9588670 — clang/test/OpenMP target_no_loop.c target_no_loop.cpp

Restructure no-loop test and cover missing cases

Group the kernels by whether they are promoted and add cases to cover
gaps pointed out in review.
DeltaFile
+173-0clang/test/OpenMP/target_no_loop.cpp
+0-138clang/test/OpenMP/target_no_loop.c
+173-1382 files

LLVM/project 6e76fe8 — clang/lib/CodeGen CGOpenMPRuntimeGPU.cpp CGStmtOpenMP.cpp, clang/lib/Frontend CompilerInvocation.cpp

Fix edge case defects and add test coverage

Disallow promotion to no-loop for kernels with non-contant or false
conditional clause that affects teams or thread number.

Add guard for 0 trip count for empty loops on host-compile and accept
oversubscription flags there so it applies, so that no-loop kernels are
correctly sized from the count and no longer result in large grid sizing
for zero extended negative iteration counts.

Add guard to write keep-alive list only on per module finalize, matching
offload entry per-module write, to avoid multiple lists with different
names, of which only the first protects its entries, leaving clang's own
list unprotected.
DeltaFile
+73-17clang/test/OpenMP/target_no_loop.cpp
+28-4clang/lib/CodeGen/CGStmtOpenMP.cpp
+15-6clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+4-6clang/lib/Frontend/CompilerInvocation.cpp
+1-1llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+121-345 files

LLVM/project 8edac52 — clang/lib/CodeGen CGStmtOpenMP.cpp CGOpenMPRuntime.h

Check the emitted loop against the promoted one

Keep KernelAttrs local and cache the eligible loop node for comparison
instead.
DeltaFile
+17-14clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+8-9clang/lib/CodeGen/CGOpenMPRuntimeGPU.h
+6-4clang/lib/CodeGen/CGOpenMPRuntime.h
+2-2clang/lib/CodeGen/CGStmtOpenMP.cpp
+33-294 files

LLVM/project 8c53a33 — clang/lib/CodeGen CGOpenMPRuntime.h CGStmtOpenMP.cpp, clang/test/OpenMP target_no_loop.c

Share one no-loop eligibility check between exec mode and body

The kernel is tagged SPMD_NO_LOOP by a single check, and the body is
emitted loop-free exactly when the kernel carries that tag. Add tests
for the clauses that block promotion.
DeltaFile
+58-1clang/test/OpenMP/target_no_loop.c
+34-19clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+11-3clang/lib/CodeGen/CGOpenMPRuntimeGPU.h
+2-11clang/lib/CodeGen/CGStmtOpenMP.cpp
+4-5clang/lib/CodeGen/CGOpenMPRuntime.h
+109-395 files

LLVM/project f592abb — clang/lib/CodeGen CodeGenFunction.h CGStmtOpenMP.cpp

Remove unused OnlyUnresolved parameter
DeltaFile
+2-16clang/lib/CodeGen/CGStmtOpenMP.cpp
+1-2clang/lib/CodeGen/CodeGenFunction.h
+3-182 files

LLVM/project 6e1f526 — clang/lib/CodeGen CodeGenFunction.cpp CGOpenMPRuntimeGPU.cpp, clang/test/OpenMP target_no_loop.c

[clang][OpenMP] Add no-loop SPMD kernel promotion

A target teams distribute parallel for that is guaranteed a thread for
every iteration does not need the loop around its body. Flang already
drops it and runs the region as a no-loop kernel.

Enable the same optimization for Clang through mirroring Flang's MLIR
promotion using OpenMPIRBuilder. The kernel is tagged SPMD_NO_LOOP, so
the runtime sizes the grid to the iteration space, and the body is
emitted without a loop around it. The canonical loop it consumes is
reconstructed in the no-loop branch rather than taken from an
OMPCanonicalLoop node, so the promotion does not require
-fopenmp-enable-irbuilder.

Restrict offload entry creation to module level finalize, preventing
asserts on missing offload entries from nested CodeGenFunction
finalizing before module completion.
DeltaFile
+127-44clang/lib/CodeGen/CGStmtOpenMP.cpp
+91-0offload/test/offloading/target-no-loop.c
+81-0clang/test/OpenMP/target_no_loop.c
+21-3clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
+10-8clang/lib/CodeGen/CodeGenFunction.cpp
+8-0llvm/include/llvm/Frontend/OpenMP/OMPIRBuilder.h
+338-553 files not shown
+350-569 files

LLVM/project b841866 — llvm/lib/Target/PowerPC PPCInstr64Bit.td PPCInstrInfo.td, llvm/test/CodeGen/PowerPC stack-protector-pcrel-indirect-tail-call.ll

[PowerPC] Fix stack protector + indirect tail call on power10 (#246638)

The issue here is that findSplitPointForStackProtector() does not
recognize the mtctr instruction as being part of the terminator sequence
(as it's not just a physreg COPY). This results in the block being split
between the physreg copies for the arguments and the call. This will
fail machine verification, and in release builds will end up removing
those copies, resulting in a miscompile.

Fix this by using a pseudo that takes a GPR and expands to mtctr plus
the usual tail-call sequence. This is implemented as a custom inserter
pseudo so we don't need to deal with register class constraints. This is
sufficient, as the stack protector split happens before finalize-isel,
so we don't need this to be an emit-time pseudo.

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

Assisted-by: Claude
DeltaFile
+53-0llvm/test/CodeGen/PowerPC/stack-protector-pcrel-indirect-tail-call.ll
+26-6llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+19-2llvm/lib/Target/PowerPC/PPCInstrInfo.td
+9-2llvm/lib/Target/PowerPC/PPCInstr64Bit.td
+107-104 files

LLVM/project 19e8a82 — llvm/docs ReleaseNotes.md, llvm/docs/CommandGuide llvm-strings.md

[llvm-strings] Add --unicode option (#242890)

This commit adds the --unicode option from GNU strings to llvm-strings.
The options from GNU strings are supported, plus an additional option
value --unicode=utf8 to explicitly request UTF-8 output, similar to how
we also add an --encoding=utf8 option value to explicitly specify the
input is UTF-8.

This makes a slight change from what was previously proposed: it adds
`--unicode=utf8` as an option value, and rather than `--unicode=default`
specifying UTF-8 output, it is equivalent to leaving out the option.
This makes a difference only in one corner case: this makes
`--encoding=S` and `--encoding=S --unicode=default` behave the same, as
the option implies.
DeltaFile
+209-41llvm/tools/llvm-strings/llvm-strings.cpp
+76-0llvm/test/tools/llvm-strings/unicode.test
+48-10llvm/test/tools/llvm-strings/locale.test
+17-1llvm/docs/CommandGuide/llvm-strings.md
+3-1llvm/docs/ReleaseNotes.md
+2-0llvm/tools/llvm-strings/Opts.td
+355-536 files

LLVM/project 9057a37 — llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll low-trip-count.ll

[VPlan] Pull header mask out of (HM && Y) | (HM && Z)

The current (X && Y) | (X && Z) -> X && (Y | Z) combine requires one of the operands to have a single user. But if X is the header mask we usually want to do this regardless, similar to the reasoning behind reassociateHeaderMask.

This removes header masks in a good few places on RISC-V across llvm-test-suite and SPEC CPU 2017.
DeltaFile
+8-9llvm/test/Transforms/LoopVectorize/RISCV/low-trip-count.ll
+3-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-1llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+12-123 files

LLVM/project 0493d16 — clang/test/OpenMP thread_limit_gpu.c num_teams_kernel_attribute.cpp, llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

[OMPIRBuilder] Fix writing of OpenMP num teams kernel attribute
DeltaFile
+47-0clang/test/OpenMP/num_teams_kernel_attribute.cpp
+42-0llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+6-6clang/test/OpenMP/thread_limit_gpu.c
+7-4llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+102-104 files

LLVM/project 8943ac6 — compiler-rt CMakeLists.txt

[cmake][compiler-rt] Remove now redundant policy(SET) (#246343)

LLVM now requires CMake 3.31 so this gets set by `cmake_minimum_required()`.
DeltaFile
+0-5compiler-rt/CMakeLists.txt
+0-51 files

LLVM/project 0c73276 — lldb/tools/driver CMakeLists.txt

[cmake][lldb][driver] Use target_link_options() (#246354)

LLVM now requires CMake 3.31 so no need for the ugly workaround.
DeltaFile
+9-7lldb/tools/driver/CMakeLists.txt
+9-71 files

LLVM/project 05074d9 — clang/test/OpenMP thread_limit_gpu.c num_teams_kernel_attribute.cpp, llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp

[OMPIRBuilder] Fix writing of OpenMP num teams kernel attribute
DeltaFile
+47-0clang/test/OpenMP/num_teams_kernel_attribute.cpp
+42-0llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+18-8llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+6-6clang/test/OpenMP/thread_limit_gpu.c
+113-144 files

LLVM/project d8fbd71 — llvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll

[VPlan] Erase dead masks in removeCommonBlendMask

removeCommonBlendMask was leaving behind the old masks, which can cause other masks to still have dead recipes as users. This in turn prevents simplifyBlends from picking a start value for a blend that would have been dead-coded.

Erasing them improves codegen in various benchmarks, for example on sqlite with clang -march=rva23u64 -O3:

  void sqlite3HexToBlob(int *restrict dst, int *restrict src, int n) {
    for (int i = 0; i < n; i++) {
      int h = src[i], x;
      if (h >= '0' && h <= '9')
        x = h - '0';
      else if (h >= 'a' && h <= 'f')
        x = h - 'a' + 10;
      else
        x = h - 'A' + 10;
      dst[i] = x;
    }
  }


    [39 lines not shown]
DeltaFile
+6-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+2-4llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+8-62 files

LLVM/project 7de38ae — llvm/lib/Target/RISCV RISCVInstrGISel.td, llvm/lib/Target/RISCV/GISel RISCVLegalizerInfo.cpp RISCVInstructionSelector.cpp

[RISCV][GISel] Select scalable integer G_SPLAT_VECTOR (#247751)

Lower G_SPLAT_VECTOR with a scalar on the GPR bank to G_VMV_V_X_VL in
the instruction selector, with an undef passthru and VL set to VLMAX.
This matches what RISCVDAGToDAGISel::PreprocessISelDAG does for
SPLAT_VECTOR,
so the existing vmv.v.x patterns are reused.

Add a G_VMV_V_X_VL generic instruction equivalent to riscv_vmv_v_x_vl.
Also specify the legal G_SPLAT_VECTOR legalizer actions before the
custom one.

Part of #246831
DeltaFile
+235-0llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv/splatvector-rv64.mir
+193-0llvm/test/CodeGen/RISCV/GlobalISel/instruction-select/rvv/splatvector-rv32.mir
+60-0llvm/test/CodeGen/RISCV/GlobalISel/rvv/splat-vector.ll
+32-0llvm/lib/Target/RISCV/GISel/RISCVInstructionSelector.cpp
+8-0llvm/lib/Target/RISCV/RISCVInstrGISel.td
+3-2llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+531-26 files

LLVM/project ddf1a96 — llvm/test/CodeGen/Hexagon fptoi.sat.ll hlx-masked-load-store.ll, llvm/test/CodeGen/Hexagon/autohvx fp-to-int_2.ll cttz-elts-split.ll

[Hexagon] Disable global scheduler V2 by default (#247953)

Make -enable-global-sched default to false, until reported issues in the
pass are addressed. Hand-written tests that exercise it set
-enable-global-sched=true explicitly, and the autogenerated CHECK lines
are regenerated with the pass disabled.

Assisted by AI
DeltaFile
+91-85llvm/test/CodeGen/Hexagon/autohvx/int-to-fp.ll
+22-20llvm/test/CodeGen/Hexagon/autohvx/fp-to-int.ll
+10-10llvm/test/CodeGen/Hexagon/autohvx/cttz-elts-split.ll
+8-3llvm/test/CodeGen/Hexagon/hlx-masked-load-store.ll
+4-4llvm/test/CodeGen/Hexagon/fptoi.sat.ll
+4-4llvm/test/CodeGen/Hexagon/autohvx/fp-to-int_2.ll
+139-12644 files not shown
+196-17950 files

LLVM/project 9aa0a03 — llvm/lib/Target/RISCV RISCVCodeGenPrepare.cpp

Address review comment
DeltaFile
+2-2llvm/lib/Target/RISCV/RISCVCodeGenPrepare.cpp
+2-21 files

LLVM/project bdd09fc — llvm/lib/Target/AVR AVRRegisterInfo.cpp

[AVR] Fix a warning (NFC) (#247959)

This patch fixes:

    llvm/lib/Target/AVR/AVRRegisterInfo.cpp:255:12: error: unused
    variable 'Opc' [-Werror,-Wunused-variable]

Assisted-by: Antigravity
DeltaFile
+1-1llvm/lib/Target/AVR/AVRRegisterInfo.cpp
+1-11 files

LLVM/project 5ac9df5 — llvm/test/Transforms/LoopVectorize/RISCV tail-folding-complex-mask.ll

Precommit tests
DeltaFile
+131-0llvm/test/Transforms/LoopVectorize/RISCV/tail-folding-complex-mask.ll
+131-01 files

LLVM/project 022249b — llvm/lib/CodeGen InlineSpiller.cpp, llvm/lib/Target/X86 X86InstrInfo.cpp

[X86][APX] Don't fold an NDD reload that needs a COPY into a split register (#246808)

This is an alternative solution to #237148 and #243055. If the
destination was created by splitting or spilling, just refuse the fold
rather than post handling the inserted COPY. It avoids unnecessary
spill/reload due to the COPY handling.

Assisted-by: Claude Opus 5.5
DeltaFile
+5-26llvm/lib/CodeGen/InlineSpiller.cpp
+11-11llvm/test/CodeGen/X86/apx/inline-spiller-hoist-folded-copy.ll
+6-6llvm/test/CodeGen/X86/apx/memfold-origVNI-crash.ll
+6-3llvm/lib/Target/X86/X86InstrInfo.cpp
+28-464 files

LLVM/project caf64f6 — llvm/lib/Target/AVR AVRInstrInfo.td AVRRegisterInfo.cpp, llvm/test/CodeGen/AVR alloca.ll issue-246837.ll

[AVR] Remove incorrect selection patterns of two pseudo instructions (#247453)

Remove the selection patterns of STDWSPQRr/STDSPQRr, which cannot guarantee the base pointer is the SP register..

Fixes https://github.com/llvm/llvm-project/issues/246837.
DeltaFile
+77-0llvm/test/CodeGen/AVR/issue-246837.ll
+5-9llvm/lib/Target/AVR/AVRRegisterInfo.cpp
+5-7llvm/test/CodeGen/AVR/alloca.ll
+2-2llvm/lib/Target/AVR/AVRInstrInfo.td
+89-184 files

LLVM/project 8518e9c — llvm/lib/Target/DirectX CMakeLists.txt DirectXTargetMachine.h, llvm/test/CodeGen/DirectX newpm-pipeline.ll

[DirectX] Wire up CodeGenPassBuilder

Introduce DirectXCodeGenPassBuilder and wire up the pass pipeline to be
the same as the existing DirectXPassConfig/addPassesToEmitFile.

Assisted-By: LLM

Reviewers: hekota, bogner

Pull Request: https://github.com/llvm/llvm-project/pull/244834
DeltaFile
+152-0llvm/lib/Target/DirectX/DirectXCodeGenPassBuilder.cpp
+42-0llvm/test/CodeGen/DirectX/newpm-pipeline.ll
+0-9llvm/lib/Target/DirectX/DirectXTargetMachine.cpp
+7-0llvm/lib/Target/DirectX/DirectXTargetMachine.h
+2-0llvm/lib/Target/DirectX/CMakeLists.txt
+203-95 files

LLVM/project e4a87c9 — llvm/include/llvm/Passes CodeGenPassBuilder.h, llvm/lib/Passes CodeGenPassBuilder.cpp

[NFC][CodeGen][NewPM] Allow overriding buildPipeline

Also some refactoring around registerAsmPrinter to make targets that
want to override the entire pipeline (e.g., DirectX) easier. We can't
just do everything in buildCodeGenPipeline or otherwise we need to
reinvent all the start/stop machinery.

Assisted-By: LLM

Reviewers: arsenm, aeubanks

Pull Request: https://github.com/llvm/llvm-project/pull/244833
DeltaFile
+31-12llvm/lib/Passes/CodeGenPassBuilder.cpp
+10-0llvm/include/llvm/Passes/CodeGenPassBuilder.h
+41-122 files

LLVM/project 2ce491c — llvm/lib/Target/Hexagon HexagonVLIWPacketizer.cpp, llvm/test/CodeGen/Hexagon/autohvx hvx-store-packet-order.mir

[Hexagon] Don't packetize a slot-0-only store with a later aliasing store (#246713)

When two stores in a packet write to the same location, the one in slot
0 takes effect last. The shuffler keeps program order by putting the
first store in slot 1, but it cannot when the first store can only go in
slot 0, such as an HVX vmem. The packetizer allowed any store followed
by a store, so the HVX store then overwrote the later store.
This miscompiles a variable-index insert element into a vector on the
stack: the vector spill and the element store land in one packet, and
the inserted element is lost.
Fixes #246036.
_AI Usage: Claude Code_

---------

Co-authored-by: soumikiith <cs21resch11004 at iith.ac.in>
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+85-0llvm/test/CodeGen/Hexagon/autohvx/hvx-store-packet-order.mir
+10-1llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp
+95-12 files

LLVM/project 6469bd5 — llvm/lib/Target/Hexagon HexagonPostRAHandleQFP.cpp, llvm/test/CodeGen/Hexagon/autohvx xqf-postra-partial-pair-refill.mir

[Hexagon] Handle partially redefined QFP pair refills (#244193)

Add the conversion instruction for a subregister selectively if the
subregister has not been redefined.

Fixes #237218

Assisted by AI.

---------

Co-authored-by: quic-santdas <quic_santdas at qti.qualcomm.com>
DeltaFile
+48-10llvm/lib/Target/Hexagon/HexagonPostRAHandleQFP.cpp
+47-0llvm/test/CodeGen/Hexagon/autohvx/xqf-postra-partial-pair-refill.mir
+95-102 files