LLVM/project f3aa3fbllvm/lib/Transforms/InstCombine InstCombineMulDivRem.cpp, llvm/test/Transforms/InstCombine div.ll

[InstCombine] Fold consecutive udivs into a single udiv (#214541)

Extend the existing `(X / C1) / C2 -> X / (C1 * C2)` fold to variable
divisors:

    (X udiv Y) udiv Z -> X udiv (Y * Z)   if Y * Z does not overflow

Uses willNotOverflowUnsignedMul to prove the product doesn't wrap.
Instruction count is unchanged but a division becomes a multiplication,
similar to the existing cttz-based udiv->lshr fold in visitUDiv.

One-use on the inner div, since otherwise we'd add a mul without
removing
the div. exact only propagates when both divides are exact.

Alive2: https://alive2.llvm.org/ce/z/qV6UJH

Fixes #132908
DeltaFile
+96-0llvm/test/Transforms/InstCombine/div.ll
+14-0llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+110-02 files

LLVM/project cd40fd7clang/lib/AST/ByteCode Interp.cpp

[clang][bytecode] Use PtrView in finishGlobalRecurse() (#215088)

So we create fewer Pointer instances.
DeltaFile
+7-8clang/lib/AST/ByteCode/Interp.cpp
+7-81 files

LLVM/project 273eb20mlir/include/mlir/Dialect/Vector/Transforms VectorRewritePatterns.h

[mlir] Remove dead declarations in VectorRewritePatterns.h (#215083)

rewriteBitCastOfTruncI and rewriteExtOfBitCast were introduced on
September 18, 2023 in commits bf7c490ab73a22620c3d7790c09bfb11b669e51b
and 04ba475e85cb97e9006a130855b76479b5149f47, respectively, without
corresponding function definitions.
DeltaFile
+0-15mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h
+0-151 files

LLVM/project 78e17e7mlir/lib/Dialect/Arith/IR ArithOps.cpp

[mlir][arith][NFC] Make AtomicRMWKind switches exhaustive (#214622)

`getIdentityValueAttr` and `getReductionOp` in `ArithOps.cpp` each
handle 15 of
the 16 `AtomicRMWKind` cases and route the rest through a `default:`
label
carrying `// TODO: Add remaining reduction operations.`

That TODO cannot be completed. The only unhandled kind is `assign`,
which is
not a reduction: it has no identity element (`assign(x, e) = e`, so no
constant
`e` satisfies `assign(x, e) = x`) and no corresponding binary `arith`
op. It is
still a perfectly valid kind elsewhere — `memref.atomic_rmw` lowers it
to an
atomic `xchg` in `MemRefToLLVM.cpp` — it simply has no meaning for these
two
reduction helpers.

    [39 lines not shown]
DeltaFile
+6-6mlir/lib/Dialect/Arith/IR/ArithOps.cpp
+6-61 files

LLVM/project 7c78d38llvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp

Apply suggestion from @shiltian
DeltaFile
+1-1llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+1-11 files

LLVM/project 6c02dacllvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp

Apply suggestion from @shiltian
DeltaFile
+1-1llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+1-11 files

LLVM/project 20e75d4llvm/lib/Transforms/Vectorize VPlanConstruction.cpp, llvm/test/Transforms/LoopVectorize first-order-recurrence-chains.ll

[VPlan] Verify hoist point when hoisting previous value of a recurrence. (#215084)

tryToSinkOrHoistRecurrenceUsers processes the fixed-order recurrences of
a loop one at a time and updates the plan for each of them. Once the
plan has been updated for one recurrence, the properties
hoistPreviousBeforeFORUsers relies on may no longer hold for the
recurrences processed later

Convert dominance assertion that does not hold in all cases (added test
cases) to a bail out, to a crash on the added test.

PR: https://github.com/llvm/llvm-project/pull/215084
DeltaFile
+222-0llvm/test/Transforms/LoopVectorize/first-order-recurrence-chains.ll
+15-7llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+237-72 files

LLVM/project 3b0bb10llvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp, llvm/test/MC/Disassembler/AMDGPU decode-err.txt

[AMDGPU][MC] Return fail when the decoding is not an VGPR

Fixes #215000.
DeltaFile
+13-0llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
+2-1llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+15-12 files

LLVM/project 6b7830cllvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/lib/Transforms/Vectorize/SLPVectorizer SLPCompatibilityAnalysis.h SLPCompatibilityAnalysis.cpp

[𝘀𝗽𝗿] initial version

Created using spr 1.3.7
DeltaFile
+219-89llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+59-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.cpp
+6-17llvm/test/Transforms/SLPVectorizer/vectorize-reorder-alt-shuffle.ll
+13-0llvm/lib/Transforms/Vectorize/SLPVectorizer/SLPCompatibilityAnalysis.h
+1-11llvm/test/Transforms/SLPVectorizer/X86/BinOpSameOpcodeHelper.ll
+4-7llvm/test/Transforms/SLPVectorizer/X86/supernode.ll
+302-1246 files

LLVM/project 0815853llvm/lib/Target/AMDGPU/Disassembler AMDGPUDisassembler.cpp, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.cpp AMDGPUBaseInfo.h

[AMDGPU][MC] Check availability of certain registers (#214973)

Fixes #214952.
DeltaFile
+33-26llvm/test/MC/AMDGPU/literals.s
+40-11llvm/lib/Target/AMDGPU/Disassembler/AMDGPUDisassembler.cpp
+30-0llvm/test/MC/Disassembler/AMDGPU/decode-err.txt
+14-1llvm/test/MC/AMDGPU/gfx1250_asm_operands.s
+6-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.h
+5-0llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+128-381 files not shown
+130-397 files

LLVM/project a132a22llvm/include/llvm/ExecutionEngine/Orc CallableTraitsHelper.h, llvm/unittests/ExecutionEngine/Orc CMakeLists.txt CallableTraitsHelperTest.cpp

[ORC] Remove CallableTraitsHelper (#215089)

CallableTraitsHelper was only used by CallViaEPC.h / CallSPSViaEPC.h,
which were removed in the previous commit. With those gone it has no
remaining users, so remove it and its unit test.
DeltaFile
+0-74llvm/include/llvm/ExecutionEngine/Orc/CallableTraitsHelper.h
+0-70llvm/unittests/ExecutionEngine/Orc/CallableTraitsHelperTest.cpp
+0-1llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
+0-1llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
+0-1464 files

LLVM/project c3278d5clang-tools-extra/clang-tidy ClangTidyModuleRegistry.h, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Remove deprecated `ClangTidyModuleRegistry.h` (#215055)

Close #173414.
DeltaFile
+0-21clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h
+4-0clang-tools-extra/docs/ReleaseNotes.md
+4-212 files

LLVM/project 7e0a4eellvm/lib/Transforms/Vectorize SLPVectorizer.cpp, llvm/test/Transforms/SLPVectorizer/RISCV spillcost-loop-invariant-gather.ll

[SLP]Charge spill cost for loop-invariant gathers live over a call

Loop-invariant gathers hoisted to the preheader by
optimizeGatherSequence are live across calls in the loop body and need
spill/reload on targets with call-clobbered vector registers, but were
skipped by getSpillCost. Charge them like other call-crossing values.

Fixes #214555

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/215093
DeltaFile
+14-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+9-5llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
+23-62 files

LLVM/project 6860517llvm/test/Transforms/SLPVectorizer/RISCV spillcost-loop-invariant-gather.ll

[SLP][NFC]Add a test with the spills for loop invariants, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/215092
DeltaFile
+79-0llvm/test/Transforms/SLPVectorizer/RISCV/spillcost-loop-invariant-gather.ll
+79-01 files

LLVM/project 0311761llvm/test/CodeGen/ARM vector-lrint.ll, llvm/test/CodeGen/X86 vector-llrint.ll fp128-libcalls-strict-gnu.ll

RuntimeLibcalls: Fix reporting incorrectly typed fp128 long double functions

l-suffixed long double math functions are fp128 only when the target's
long double is fp128. The default set provided them on every target that was
not x87 or ppc_fp128, so targets using double as long double wrongly reported
the fp128 l-suffixed functions.

Update tests that were reliant on phantom fp128 calls. These are only available
with glibc on select targets. In cases where the target supports the calls in
some triple, split the tests. In cases where the target has no fp128 library
support, delete the tests.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+21-3,157llvm/test/CodeGen/X86/fp128-libcalls-strict.ll
+5-2,046llvm/test/CodeGen/X86/fp128-libcalls.ll
+0-1,547llvm/test/CodeGen/X86/vector-lrint.ll
+1,283-0llvm/test/CodeGen/X86/fp128-libcalls-strict-gnu.ll
+0-1,205llvm/test/CodeGen/ARM/vector-lrint.ll
+0-868llvm/test/CodeGen/X86/vector-llrint.ll
+1,309-8,82347 files not shown
+2,503-12,08353 files

LLVM/project 1a08c40llvm/include/llvm/ExecutionEngine/Orc CallSPSViaEPC.h CallViaEPC.h, llvm/unittests/ExecutionEngine/Orc CMakeLists.txt CallSPSViaEPCTest.cpp

[ORC] Remove CallViaEPC.h and CallSPSViaEPC.h (#215086)

These provided EPC calls with pluggable serialization (EPCCaller /
EPCCall / SPSEPCCaller / SPSEPCCall). That role is now filled by the
RTBridge Proxy APIs (rt::Proxy + rt::sps::ProxySpec), and these headers
had no users other than their own unit test, so remove them along with
CallSPSViaEPCTest.
DeltaFile
+0-173llvm/unittests/ExecutionEngine/Orc/CallSPSViaEPCTest.cpp
+0-153llvm/include/llvm/ExecutionEngine/Orc/CallViaEPC.h
+0-95llvm/include/llvm/ExecutionEngine/Orc/CallSPSViaEPC.h
+0-1llvm/utils/gn/secondary/llvm/unittests/ExecutionEngine/Orc/BUILD.gn
+0-1llvm/unittests/ExecutionEngine/Orc/CMakeLists.txt
+0-4235 files

LLVM/project 3763538clang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode][NFC] Fix some comment typos (#215078)
DeltaFile
+2-2clang/lib/AST/ByteCode/Compiler.cpp
+2-21 files

LLVM/project 0fc8b69llvm/lib/CodeGen/SelectionDAG LegalizeTypes.h LegalizeDAG.cpp, llvm/test/CodeGen/AMDGPU fneg.ll

DAG: Gracefully diagnose missing soft-float and strict-FP libcalls

Several soft-float legalization paths legalizer, called into a libcall
without checking whether the target provides one, fatally erroring for
fp128 operations on targets with no soft-float support.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+45-11llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+35-0llvm/test/CodeGen/NVPTX/f128-no-libcall-error.ll
+10-4llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+2-2llvm/test/CodeGen/AMDGPU/fneg.ll
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+93-175 files

LLVM/project 44ac984llvm/lib/CodeGen/SelectionDAG LegalizeTypes.h LegalizeFloatTypes.cpp, llvm/test/CodeGen/X86 xrint-no-libcall-error.ll

DAG: Gracefully diagnose missing lrint/lround float-operand libcalls

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+32-36llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+12-0llvm/test/CodeGen/X86/xrint-no-libcall-error.ll
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+45-363 files

LLVM/project adb8adcllvm/lib/CodeGen/SelectionDAG LegalizeIntegerTypes.cpp, llvm/test/CodeGen/X86 xrint-no-libcall-error.ll

DAG: Gracefully diagnose missing lrint/llrint/lround/llround libcall

Avoid hitting the fatal error in makeLibCall by emitting a diagnostic
if the library call is unsupported.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+28-0llvm/test/CodeGen/X86/xrint-no-libcall-error.ll
+13-3llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
+41-32 files

LLVM/project d99bd3ellvm/include/llvm/ExecutionEngine/Orc/RTBridge Calls.h Proxy.h, llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS ProxySpecs.h

[ORC] Rename RTBridge Caller to Proxy (#215077)

Mechanical rename of the controller-side call handle, with no functional
change:

- rt::Caller<Sig> -> rt::Proxy<Sig> (and CallerBase / CallerInit /
callerInit / buildCallers -> Proxy*), RTBridge/Calls.h ->
RTBridge/Proxy.h.
- rt::sps::CallerSpec -> rt::sps::ProxySpec, RTBridge/SPS/Calls.h ->
RTBridge/SPS/ProxySpecs.h.
- The named proxies for function-calling wrappers gain a Call verb
(CallMainProxy, CallInt32Int32Proxy, ...), matching the
orc_rt_ci_sps_call_* wrappers they target.

This frees "caller" for the executor-side concept: a runtime function
that calls another function.

Also split the unit test along the same seam: ProxyTest.cpp covers
generic, protocol-agnostic rt::Proxy behavior via an in-process dispatch
(no serialization), and SPSProxiesTest.cpp covers the SPS proxies'
serialization round-trips.
DeltaFile
+0-318llvm/unittests/ExecutionEngine/Orc/SPSCallersTest.cpp
+256-0llvm/unittests/ExecutionEngine/Orc/ProxyTest.cpp
+209-0llvm/unittests/ExecutionEngine/Orc/SPSProxiesTest.cpp
+0-206llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Calls.h
+206-0llvm/include/llvm/ExecutionEngine/Orc/RTBridge/Proxy.h
+94-0llvm/include/llvm/ExecutionEngine/Orc/RTBridge/SPS/ProxySpecs.h
+765-5247 files not shown
+783-63513 files

LLVM/project 14c563ellvm/test/Transforms/LoopVectorize outer_loop_contiguous.ll

[VPlan] Add tests for outer-loop accesses with irregular types (NFC). (#215075)

Add coverage for stride-1 outer-loop accesses of element types that are
bit-packed in vectors (i1, i4).

While touching the file, remove some unnecessary checks.
DeltaFile
+318-125llvm/test/Transforms/LoopVectorize/outer_loop_contiguous.ll
+318-1251 files

LLVM/project c447f60llvm/lib/Target/Sparc/MCTargetDesc SparcAsmBackend.cpp, llvm/test/MC/Sparc/Relocations relocation-specifier.s absolute-hi-lo.s

[SPARC] Fix %hi/%lo of absolute expressions in PIC mode (#215066)

adjustPICRelocation maps %hi/%lo to GOT22/PC22 or GOT10/PC10 at parse
time, before the operand is known to be absolute. adjustFixupValue has
no case for the GOT types, so an absolute operand encodes the unshifted
value:

Encode %got22/%got10 like %hi/%lo. Also drop them as input syntax; GNU
as has no such operators.
DeltaFile
+35-0llvm/test/MC/Sparc/Relocations/absolute-hi-lo.s
+14-0llvm/test/MC/Sparc/Relocations/relocation-specifier.s
+4-0llvm/lib/Target/Sparc/MCTargetDesc/SparcAsmBackend.cpp
+53-03 files

LLVM/project 2f09d67llvm/lib/CodeGen/SelectionDAG LegalizeTypes.h LegalizeDAG.cpp, llvm/test/CodeGen/AMDGPU fneg.ll

DAG: Gracefully diagnose missing soft-float and strict-FP libcalls

Several soft-float legalization paths legalizer, called into a libcall
without checking whether the target provides one, fatally erroring for
fp128 operations on targets with no soft-float support.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+45-11llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+35-0llvm/test/CodeGen/NVPTX/f128-no-libcall-error.ll
+10-4llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+2-2llvm/test/CodeGen/AMDGPU/fneg.ll
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+93-175 files

LLVM/project 5371bcallvm/include/llvm/Support GenericDomTree.h, llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

[DomTree] Remove the DomTreeNodeBase overload of isReachableFromEntry. NFC (#215068)

The overload is `return A;`, which is not useful.
DeltaFile
+4-7llvm/include/llvm/Support/GenericDomTree.h
+1-3llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+5-102 files

LLVM/project ff2f56cllvm/include/llvm/Support KnownBits.h, llvm/lib/CodeGen/GlobalISel GISelValueTracking.cpp

[GlobalISel] Add G_ROTL/G_ROTR to computeNumSignBits (#213364)

Port SelectionDAG's `ROTL`/`ROTR` handling to
`GISelValueTracking::computeNumSignBits`.
Addresses one of the subtasks of #150515.

---
Assisted by Claude (Anthropic).
DeltaFile
+67-1llvm/test/CodeGen/AArch64/GlobalISel/knownbits-rotl-rotr.mir
+6-18llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+23-0llvm/lib/Support/KnownBits.cpp
+10-0llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp
+8-0llvm/include/llvm/Support/KnownBits.h
+114-195 files

LLVM/project 640cfb4clang/lib/CIR/CodeGen CIRGenBuiltinAMDGPU.cpp, clang/test/CIR/CodeGenHIP builtins-amdgcn-gfx10.hip builtins-amdgcn-gfx11.hip

[CIR][AMDGPU] Add support for AMDGCN permlane builtins (#197526)

Adds codegen for the following AMDGCN permlane builtins:

- __builtin_amdgcn_permlane16
- __builtin_amdgcn_permlane64
- __builtin_amdgcn_permlanex16

These are lowered to the corresponding `llvm.amdgcn.permlane16`,
`llvm.amdgcn.permlanex16`, and `llvm.amdgcn.permlane64` intrinsics.
DeltaFile
+110-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx11.hip
+58-0clang/test/CIR/CodeGenHIP/builtins-amdgcn-gfx10.hip
+9-6clang/lib/CIR/CodeGen/CIRGenBuiltinAMDGPU.cpp
+177-63 files

LLVM/project fb7a4edllvm/lib/CodeGen/SelectionDAG LegalizeTypes.h LegalizeDAG.cpp, llvm/test/CodeGen/NVPTX f128-no-libcall-error.ll

DAG: Gracefully diagnose missing soft-float and strict-FP libcalls

Several soft-float legalization paths legalizer, called into a libcall
without checking whether the target provides one, fatally erroring for
fp128 operations on targets with no soft-float support.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+45-11llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+35-0llvm/test/CodeGen/NVPTX/f128-no-libcall-error.ll
+10-4llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+1-0llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
+91-154 files

LLVM/project 05142fcflang/include/flang/Optimizer/Dialect FIROps.td, flang/lib/Optimizer/Dialect FIROps.cpp

[flang] Reject module-scope fir.alloca (#214157)

`fir.alloca` represents a stack allocation, but its verifier currently
accepts operations placed directly in a `builtin.module`. During
FIR-to-LLVM conversion, `AllocaOpConversion::matchAndRewrite` calls
`getBlockForAllocaInsert`, which performs a `dyn_cast` to
`OutlineableOpenMPOpInterface` on the alloca's parent op.

For a module-level alloca the expected parent function/block does not
exist and the cast/assert fails.

This patch rejectsdirect module-scope `fir.alloca` operations during FIR
verification.

Assisted-by: codex

---------

Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha at gmail.com>
DeltaFile
+5-0flang/test/Fir/invalid.fir
+3-0flang/include/flang/Optimizer/Dialect/FIROps.td
+2-0flang/lib/Optimizer/Dialect/FIROps.cpp
+10-03 files

LLVM/project d8145e7flang/include/flang/Semantics tools.h, flang/lib/Lower ConvertVariable.cpp

[Flang] Coarray allocation, update error for pointer component #193829 (#194651)

The TODO message in `verify()` was not completly displayed, so it has
been replaced by `emitErrorOp`.
In addition, the test in `ConvertVariable` has been updated by adding
pointer direct component case.
Fix #193829

(cherry picked from commit 9adc2537177d0813301b3eab1bae906735c984a4)
DeltaFile
+15-3flang/lib/Lower/ConvertVariable.cpp
+3-3flang/lib/Optimizer/Dialect/MIF/MIFOps.cpp
+5-0flang/lib/Semantics/tools.cpp
+2-1flang/test/Lower/MIF/coarray_allocation3.f90
+2-0flang/include/flang/Semantics/tools.h
+27-75 files