LLVM/project 6065368 — llvm/lib/Transforms/Vectorize VectorCombine.cpp

fixup! Do not use ArrayRef as key
DeltaFile
+4-3llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+4-31 files

LLVM/project 83a1950 — llvm/include/llvm/MC MCDwarf.h MCSection.h, llvm/lib/MC MCStreamer.cpp MCDwarf.cpp

[MC] Emit line table rows for subsections in layout order (#242138)

Line table entries are recorded per section in emission order, but
subsections are laid out after subsection 0 in increasing order of their
numbers. For example, assembling the following with -g:
```
    .text
    nop               # 0x0
    .subsection 1
    nop               # 0x2
    .subsection 0
    nop               # 0x1
```
produces rows for 0x0, 0x2 and 0x1, in that order. The negative address
delta of the last row is encoded as a wrapped-around unsigned
DW_LNS_advance_pc operand. DWARF requires addresses to only increase
within a sequence: llvm-dwarfdump --verify reports "decreases in address
from previous row", and consumers using checked arithmetic, such as
gimli, reject the whole line program. The Linux kernel hits this on

    [21 lines not shown]
DeltaFile
+99-0llvm/test/DebugInfo/X86/debug-line-subsection.ll
+88-0llvm/test/MC/ELF/debug-line-subsection.s
+25-6llvm/lib/MC/MCDwarf.cpp
+4-3llvm/lib/MC/MCStreamer.cpp
+7-0llvm/include/llvm/MC/MCSection.h
+3-0llvm/include/llvm/MC/MCDwarf.h
+226-96 files

LLVM/project c5d2fa0 — llvm/test/tools/dsymutil/AArch64 mergeable-libs-relocation-map.test mergeable-libs-relocations-lost.test, llvm/tools/dsymutil DwarfLinkerForBinary.h DwarfLinkerForBinary.cpp

[dsymutil] Warn when the relocations of an object file were all lost (#241515)

A valid relocation is against a symbol of the binary, whose DIE is kept
along with the relocation.
An object file with valid relocations that saves none of them to the
relocation map has lost them, and merging the library would drop its
debug info.
That is how the relocation maps came out empty without notice. dsymutil
now warns about it.

Depends on #241512, only the last commit is new.
DeltaFile
+25-0llvm/test/tools/dsymutil/AArch64/mergeable-libs-relocations-lost.test
+10-2llvm/tools/dsymutil/DwarfLinkerForBinary.cpp
+9-1llvm/tools/dsymutil/DwarfLinkerForBinary.h
+1-1llvm/test/tools/dsymutil/AArch64/mergeable-libs-relocation-map.test
+45-44 files

LLVM/project be613e9 — llvm/lib/Transforms/IPO InferFunctionAttrs.cpp, llvm/test/Transforms/InferFunctionAttrs preserve-function-analyses.ll

Also lcg
DeltaFile
+4-3llvm/test/Transforms/InferFunctionAttrs/preserve-function-analyses.ll
+2-0llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
+6-32 files

LLVM/project af36994 — llvm/lib/Transforms/InstCombine InstCombineInternal.h InstCombineCompares.cpp, llvm/test/Transforms/InstCombine icmp-ugt-of-shl-1-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll

[InstCombine] Fold either-operand icmp patterns in foldICmpCommutative

Second patch in the icmp opcode-switch series. Five folds in the tail of
`visitICmpInst` accept their pattern on either operand, using `m_c_ICmp` or
hand-written checks of both orders, and we try all of them on every icmp.

This patch rewrites each one to look at Op0 only, and dispatches it on Op0's
opcode from a function that we call once per operand order, as we already do
for `foldICmpCommutative`.

The sub-vs-add fold becomes a `Sub` case of `foldICmpCommutative`. The rest go
into a second switch, `foldICmpCommutativeLate`, called right after
`foldICmpEquality`:
- the uadd.with.overflow idiom and `foldICmpWithHighBitMask` under `Add`
- `foldICmpPow2Test` under `And`
- `foldICmpPow2Test` and `foldICmpWithHighBitMask` under `Xor`
- `foldICmpWithHighBitMask` under `Shl`
- `foldICmpOfUAddOv` under `ExtractValue`
- the shr/ext sign-bit fold under `LShr`/`AShr`

    [17 lines not shown]
DeltaFile
+150-129llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+2-2llvm/test/Transforms/InstCombine/icmp-ugt-of-shl-1-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll
+2-0llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+154-1313 files

LLVM/project 0ef0283 — llvm/lib/Transforms/InstCombine InstCombineInternal.h InstCombineCompares.cpp

[InstCombine] Move more icmp folds keyed on Op0 into the switch

`visitICmpInst` now has a long linear tail of fold patterns that we test
one-by-one. Each of them reloads and recomputes its matcher criteria
independently, and we spend O(#folds) instructions searching for a match.

This is the first of three patches that reshape `visitICmpInst` to be more
switch-driven, as we did in #243249 for `foldICmpCommutative`. The idea is to
switch on an operand's opcode, and keep each fold in the case for the opcode it
needs. This patch covers 10 simple folds keyed only on the Op0 opcode.

Four of them are folds of `icmp Op0, C`, and move into the existing switch in
`foldICmpInstWithConstantNotInt`:
- `(X & ~Y) ==/!= 0` and `sext(A) & C1 ==/!= C2` under `And`
- the `(zext X) +/* (zext Y)` overflow idiom under `Add`/`Mul`
- `foldICmpOfVectorReduce` under `Call`

The three constant-RHS entry points now sit behind one `isa<Constant>(Op1)`
test.

    [22 lines not shown]
DeltaFile
+159-101llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+1-0llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+160-1012 files

LLVM/project 70a529a — llvm/test/Transforms/InstCombine icmp-ugt-of-shl-1-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll

[InstCombine] Add test expectations for `icmp ult (1 << a), (1 << b)`

`foldICmpWithHighBitMask` transforms `icmp ugt (1 << a), (1 << b)` into a test
of the high bits. However, we can do a similar transform for `icmp ult (1 << a),
(1 << b)`, which we currently don't have, because the fold commits to the first
operand that matches `1 << Y` and gives up if the predicate does not fit.

In anticipation of fixing that phase ordering issue, add the baseline test
expectations for this pattern.

LLM-aided
DeltaFile
+14-0llvm/test/Transforms/InstCombine/icmp-ugt-of-shl-1-by-bits-and-val-to-icmp-eq-of-lshr-val-by-bits-and-0.ll
+14-01 files

LLVM/project c63932e — llvm/lib/Transforms/InstCombine InstCombineCompares.cpp

[InstCombine] Skip icmp folds whose operand opcodes are absent

Last patch in the icmp opcode-switch series. The earlier patches moved folds
into opcode switches. The folds here cannot move, because the code around them
is order sensitive, so this patch leaves each one at its current position and
tests the operand opcodes, computed once, before attempting it.

Before the min/max bailout, `foldICmpTruncWithTruncOrExt` now runs only when
an operand is a trunc, `foldICmpUsingBoolRange` only for a zext or sext, and
`foldIsMultipleOfAPowerOfTwo` only for an and. After `foldICmpCommutative`,
`matchSymmetricPair`, `foldCmpSelectOfConstants` and the select/select
same-condition fold all need both operands to share an opcode (PHI, Call or
Select), so they now sit in a switch on that shared opcode. Most of the diff
is the reindentation of that last group.

I previously proposed adding these opcode guards in #243249, but I broke them
out into this change to profile and consider separately. The tests are at the
call sites rather than inside the helpers, so the fold order stays visible in
one place.

    [8 lines not shown]
DeltaFile
+71-50llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+71-501 files

LLVM/project f541e5d — clang/include/clang/Frontend FrontendOptions.h, clang/include/clang/Options Options.td

Reland "[RISCV] Make clang's -mcpu=help and -mtune=help accurate for RISC-V." (#244736)

With the minimal fix for flang which shares the Options.td, but not the
other code.

Original message:

Clang has multiple -mtune only CPU names like -mtune=sifive-7-series.
These should not be printed by -mcpu=help. There also RV32 and RV64 only
CPUs.

Previously we used the -mcpu=help from LLVM's MC layer to print the
names, but it doesn't have this granularity of information.

This patch special cases RISC-V in the clang driver to get the lists
from RISCVTargetParser. A new -print-supported-tune-cpus option is added
to request the tune CPU list. -mtune=help aliases this option.

The behavior for other targets is unchanged. Though X86 has similar

    [2 lines not shown]
DeltaFile
+169-0clang/test/Driver/print-supported-cpus-riscv.c
+31-2clang/tools/driver/cc1_main.cpp
+8-1clang/include/clang/Options/Options.td
+4-1flang/lib/Frontend/CompilerInvocation.cpp
+4-0clang/lib/Driver/Driver.cpp
+4-0clang/include/clang/Frontend/FrontendOptions.h
+220-41 files not shown
+223-47 files

LLVM/project e58106f — llvm/lib/Transforms/IPO InferFunctionAttrs.cpp, llvm/test/Transforms/InferFunctionAttrs preserve-function-analyses.ll

InferFunctionAttrs: Preserve CFG and TargetLibraryInfo analyses

InferFunctionAttrs reported no preserved analyses whenever it inferred
anything, which clears every cached function analysis in the module.
It only adds attributes to declarations, so preserve the CFG analyses
and TargetLibraryInfo.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+21-0llvm/test/Transforms/InferFunctionAttrs/preserve-function-analyses.ll
+6-3llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
+27-32 files

LLVM/project d7c1506 — clang/lib/CodeGen CGCall.cpp, clang/test/CIR/CodeGen zero-call-used-regs-func-attr.cpp

clang: Only add codegen function attributes to definitions

Attributes like "frame-pointer", "no-trapping-math" and
"stack-protector-buffer-size" only affect the code generated for a
function body, but were also added to every declaration. Stop adding
them when constructing the attribute list, and add them only to
function definitions.

"target-cpu" and "target-features" are left on declarations for now,
since unfortunately some targets change ABI based on them. This cuts
down on some attribute group spam. This will also simplify improved
libfunc attribute inference in the future (e.g., InferFuncAttrs could
trivially assign the authoritative attribute sets without a spurious
IR change from losing the unnecessary declaration attributes).

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+116-104clang/lib/CodeGen/CGCall.cpp
+26-26clang/test/Headers/spirv_ids.cpp
+14-15clang/test/Sema/PowerPC/libbuiltins-ctype-powerpc64.c
+12-14clang/test/CodeGenCUDA/convergent.cu
+8-14clang/test/CIR/CodeGen/zero-call-used-regs-func-attr.cpp
+6-8clang/test/CodeGenCXX/threadlocal_address.cpp
+182-18133 files not shown
+263-24839 files

LLVM/project 4b78a42 — clang/test lit.cfg.py CMakeLists.txt, clang/test/CIR/Tools cir-offload-merge.cir

[CIR] Introduce `cir-offload-merge` tool with a combine mode (#240322)

Add `cir-offload-merge`, a standalone tool that nests a host CIR module
and its device CIR modules in an offload container (the
`cir.offload.container` module added in #206576). This is the first
piece of the Host-Device CIR Combine Pipeline: passes that need both
sides of an offload compilation in one module will run on this
container, and a split mode will write the modules back out per target.

invocation:
```bash
cir-offload-merge -combine host.cir gfx90a-xnack-on.cir gfx90a-xnack-off.cir -o combined.cir
```
IR:
```mlir
module attributes {cir.offload.container} {
  module @host attributes {
      cir.lowering_options = #cir.lowering_options<..., cuda_is_device = false, hip = true, ...>,
      cir.offload.kind = #cir.offload<host>, ...} {...}

    [36 lines not shown]
DeltaFile
+197-0clang/tools/cir-offload-merge/cir-offload-merge.cpp
+106-0clang/test/CIR/Tools/cir-offload-merge.cir
+15-0clang/tools/cir-offload-merge/CMakeLists.txt
+2-0clang/test/CMakeLists.txt
+1-0clang/tools/CMakeLists.txt
+1-0clang/test/lit.cfg.py
+322-06 files

LLVM/project 9c2a426 — llvm/lib/Transforms/Vectorize VectorCombine.cpp, llvm/test/Transforms/VectorCombine deinterleave-interleave-tree.ll

fixup! Address review feedback
DeltaFile
+35-27llvm/lib/Transforms/Vectorize/VectorCombine.cpp
+40-0llvm/test/Transforms/VectorCombine/deinterleave-interleave-tree.ll
+75-272 files

LLVM/project 030a5b7 — llvm/lib/Target/SystemZ SystemZISelLowering.cpp

[SystemZ][z/OS] Fix unsued variable error

Missed a variable only used in assert. Fix is to move the call inside
the assert, and remove the variable.
DeltaFile
+1-2llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+1-21 files

LLVM/project da0c533 — clang/include/clang/CIR/Dialect/IR CIROps.td, clang/test/CIR/Transforms inline-indirect-call.cir

[CIR] Handle Indirect call in getter and setter of callee

Indirect call from function pointer has no SymbolRefAttr, which cause
assetion in dyn_cast. Handle them specially.

Assisted-by: Claude # Test
DeltaFile
+32-0clang/test/CIR/Transforms/inline-indirect-call.cir
+6-0clang/include/clang/CIR/Dialect/IR/CIROps.td
+38-02 files

LLVM/project 25b1c80 — llvm/lib/Target/SystemZ SystemZISelLowering.h SystemZISelLowering.cpp, llvm/test/CodeGen/SystemZ pdep-pext.ll

[SystemZ] Lower ISD::PDEP and ISD::PEXT on z17 using BDEPG and BEXTG (#244196)

Implement custom lowering for ISD::PDEP and ISD::PEXT on IBM z17
(Miscellaneous-Instruction-Extensions Facility 4 / arch15).

z17 introduces BDEPG (Bit Deposit) and BEXTG (Bit Extract) instructions,
which operate on left-justified (MSB-first) bit fields:
- ISD::PEXT is lowered using BEXTG followed by a right shift (by 64 -
popcount(mask)) to right-justify the extracted bits.
- ISD::PDEP is lowered by left-shifting the value (by 64 -
popcount(mask)) to align LSBs to the MSB, followed by BDEPG.
- For constant masks, popcount and shift amounts are computed at compile
time.
- Scalar sub-i64 types (i8, i16, i32) are promoted to i64.

Assisted by: IBM Bob
---------

Co-authored-by: Kazu Hirata <kazu at google.com>
DeltaFile
+938-0llvm/test/CodeGen/SystemZ/pdep-pext.ll
+66-1llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+2-0llvm/lib/Target/SystemZ/SystemZISelLowering.h
+1,006-13 files

LLVM/project 521730a — llvm/lib/Analysis ValueTracking.cpp, llvm/test/Analysis/ValueTracking signbits-extract-elt.ll

[ValueTracking] Propagate demanded lanes through bitcasts in sign-bit queries (#244290)

Map demanded result lanes back to their source lanes when splitting
integer elements in a bitcast.

Assisted by: GPT 6.1 Sol
DeltaFile
+61-0llvm/test/Analysis/ValueTracking/signbits-extract-elt.ll
+4-1llvm/lib/Analysis/ValueTracking.cpp
+65-12 files

LLVM/project 11e5f97 — mlir/lib/Interfaces SideEffectInterfaces.cpp CMakeLists.txt, mlir/test/Dialect/EmitC canonicalize.mlir

[MLIR] Filter out recursive memory effect for ReturnLike

ReturnLike interface should be rule out from the MemoryEffect check
for RecursiveMemoryEffect. It makes sense as the memory effect for
ReturnLike never effect its parent scope.

Assisted-by: Claude # Test
DeltaFile
+25-0mlir/test/Transforms/remove-dead-values.mlir
+25-0mlir/test/Transforms/canonicalize-dce.mlir
+16-0mlir/test/Dialect/SparseTensor/canonicalize.mlir
+14-1mlir/lib/Interfaces/CMakeLists.txt
+10-2mlir/lib/Interfaces/SideEffectInterfaces.cpp
+8-0mlir/test/Dialect/EmitC/canonicalize.mlir
+98-35 files not shown
+108-611 files

LLVM/project 27fdc47 — .github/workflows libc-freebsd-vm-tests.yml libc-overlay-tests.yml

[GitHub][libc] Use MinSizeRel instead of RelWithDebInfo

Comments were stale after fc60e08b4574a85f6966a751f32290f5732d1329
seeminly accidentally switched to RelWithDebInfo. Switch back to
MinSizeRel to avoid all the overhead of generating debug info.

Also drop the requirement for CMP0141 given it's explicitly set in
CMakePolicy.cmake and is also redundant after requiring CMake 3.31.

Reviewers: SchrodingerZhu, kaladron, lntue

Pull Request: https://github.com/llvm/llvm-project/pull/244733
DeltaFile
+2-4.github/workflows/libc-overlay-tests.yml
+1-3.github/workflows/libc-freebsd-vm-tests.yml
+3-72 files

LLVM/project dd74368 — .github/workflows libc-freebsd-vm-tests.yml

fix

Created using spr 1.3.7
DeltaFile
+0-1.github/workflows/libc-freebsd-vm-tests.yml
+0-11 files

LLVM/project 428d3e8 — llvm/lib/Target/AMDGPU SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU addrspacecast-known-non-null-O0.ll

[AMDGPU] Pass the cast source to isKnownNonNull in lowerADDRSPACECAST (#244287)

`lowerADDRSPACECAST` passes the cast node instead of its source to
`isKnownNonNull`. The cast node is never a frame index, a global
address, or a constant, so the check never succeeds, and SelectionDAG
checks for null when it casts an alloca or a global. At -O2 the
`nonnull` flag that IR passes set on the cast hides this, but at -O0
every such cast gets a compare and two selects. The GlobalISel path
already passes the source.

This PR was assisted by AI but I reviewed all the changes.
DeltaFile
+0-14llvm/test/CodeGen/AMDGPU/addrspacecast-known-non-null-O0.ll
+3-11llvm/test/DebugInfo/AMDGPU/debug-loc-copy.ll
+2-2llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+5-273 files

LLVM/project 4f19343 — clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp

fixup! [CIR] Wire unreachable and return to MemoryEffectsOpInterface
DeltaFile
+57-0clang/test/CIR/Transforms/cse.cir
+31-0clang/test/CIR/Transforms/canonicalize.cir
+0-23clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+2-5clang/include/clang/CIR/Dialect/IR/CIROps.td
+90-284 files

LLVM/project 4b8678a — flang/test/Fir/OpenACC legalize-data.fir, mlir/include/mlir/Dialect/OpenACC/Transforms Passes.td

[mlir][openacc] Update LegalizeDataValues to be anchored on FunctionOpInterface (#244687)

In preparation to use the pass in the CIR/OpenACC pipeline, CIR uses
cir.func that implement the FunctionOpInterface so the pass is better
anchored on it than func.func.
DeltaFile
+18-0mlir/test/Dialect/OpenACC/legalize-data-function-interface.mlir
+2-2mlir/test/Dialect/OpenACC/legalize-data.mlir
+2-1mlir/lib/Dialect/OpenACC/Transforms/LegalizeDataValues.cpp
+2-1mlir/include/mlir/Dialect/OpenACC/Transforms/Passes.td
+1-1flang/test/Fir/OpenACC/legalize-data.fir
+25-55 files

LLVM/project 2fbab0e — llvm/lib/CodeGen SelectOptimize.cpp, llvm/test/CodeGen/AArch64 selectopt.ll

[SelectOptimize] Do not convert unpredictable selects to branches in inner loops (#236418)

Inner loop select optimization does not check for unpredictable
metadata, allowing unpredictable selects to be converted to branches.

Filter out unpredictable select groups in
findProfitableSIGroupsInnerLoops and add regression tests to
AArch64/selectopt.ll covering single and dual recurrence loops.
DeltaFile
+187-0llvm/test/CodeGen/AArch64/selectopt.ll
+18-0llvm/lib/CodeGen/SelectOptimize.cpp
+205-02 files

LLVM/project 1a9bed7 — .github/workflows libc-freebsd-vm-tests.yml

fix

Created using spr 1.3.7
DeltaFile
+1-1.github/workflows/libc-freebsd-vm-tests.yml
+1-11 files

LLVM/project 6520169 — llvm/lib/Analysis LazyValueInfo.cpp, llvm/test/Transforms/CorrelatedValuePropagation cond-at-use.ll

[LVI] Raise MaxUsesToInspect limit in getValueAtUse to 6 (#241468)

Using ternary operators can result in a redundant min() operation:

```
  int need     = avail < 0 ? -avail : 0;                // -min(avail, 0)
  uint64_t add = avail < 0 ? (uint64_t)w << need : 0;   // the min is redundant
```

The same can happen when using branches (see the referenced issue below). IR and the redundant min:

```
  %5 = icmp slt i32 %4, 0
  %6 = tail call i32 @llvm.smin.i32(i32 %4, i32 0)   ; <== this can be eliminated
  %7 = sub nsw i32 0, %6
  %8 = zext i32 %1 to i64
  %9 = zext nneg i32 %7 to i64
  %10 = shl i64 %8, %9
  %11 = select i1 %5, i64 %10, i64 0

    [6 lines not shown]
DeltaFile
+68-4llvm/test/Transforms/CorrelatedValuePropagation/cond-at-use.ll
+1-2llvm/lib/Analysis/LazyValueInfo.cpp
+69-62 files

LLVM/project aa12ab4 — libc/config/linux config.json, libc/config/linux/aarch64 config.json

[libc] Switch default find_first_character impl to clang_vector

The clang_vector implementation is way faster than the SWAR
implementation and what we want to be using by default at this point.

Override AArch64 and PPC to use the word implementation as otherwise
when compiling with glibc they fall back to the arch_vector
implementation which doesn't exist.

Reviewers: jhuber6, vonosmas

Pull Request: https://github.com/llvm/llvm-project/pull/244470
DeltaFile
+7-0libc/config/linux/aarch64/config.json
+3-0libc/config/linux/power/config.json
+1-1libc/config/linux/config.json
+11-13 files

LLVM/project d88456a — clang/include/clang/ScalableStaticAnalysis/Analyses/PointerFlow PointerFlowPairs.h

Update clang/include/clang/ScalableStaticAnalysis/Analyses/PointerFlow/PointerFlowPairs.h

Co-authored-by: Rashmi Mudduluru <r_mudduluru at apple.com>
DeltaFile
+1-1clang/include/clang/ScalableStaticAnalysis/Analyses/PointerFlow/PointerFlowPairs.h
+1-11 files

LLVM/project 77312b7 — libc/src/string/memory_utils/generic inline_strlen.h

[libc] Add optimized clang_vector memchr implementation

This patch adds a reasonably optimized clang_vector based memchr
implementation. It is comparable in .text size to glibc and about 30%
faster for inputs <64 bytes (90+% of inputs for server applications). We
lose a little bit for larger inputs due to extra instructions in the
main loop that LLVM isn't able to optimize away, but not by too much.

The original implementatin was written by an agent as I prodded it to
keep making the implementation faster. Then I heavily hand-edited mostly
for style.

Assisted-By: LLM

Reviewers: lntue, jhuber6, michaelrj-google

Pull Request: https://github.com/llvm/llvm-project/pull/244469
DeltaFile
+151-22libc/src/string/memory_utils/generic/inline_strlen.h
+151-221 files

LLVM/project 3f2f59a — .github/workflows libc-freebsd-vm-tests.yml

try again

Created using spr 1.3.7
DeltaFile
+4-3.github/workflows/libc-freebsd-vm-tests.yml
+4-31 files