LLVM/project f3b3187clang/lib/Analysis CFG.cpp, clang/test/Analysis lambda-capture-init-order.cpp

[clang][CFG] Fix lambda capture evaluation order (#211877)

Previously, the captures were emitted in their spelling order - but in
the CFG that gets translared in a reversed order.
Because of this, we need to emit them in reversed order to get them
appear in their natural order.

Fixes rdar://183140177
DeltaFile
+63-0clang/test/Analysis/lambda-capture-init-order.cpp
+6-5clang/lib/Analysis/CFG.cpp
+69-52 files

LLVM/project f5652b9llvm/include/llvm/Analysis ScalarEvolutionExpressions.h ScalarEvolution.h, llvm/lib/Analysis ScalarEvolution.cpp

[SCEV] Store type of expression inline, compute up front (NFC). (#211891)

Add SCEV::Type to store the expressions immutable type. This slightly
increases object size for most sub-types, but avoids more expensive
recomputing of the type repeatedly.

Improves compile time slightly overall, more in SCEV-heavy workloads.

 * stage1-O3: -0.08%
 * stage1-ReleaseThinLTO: -0.07%
 * stage1-ReleaseLTO-g: -0.07%
 * stage1-aarch64-O3: -0.07%
 * stage2-O3: -0.08%


https://llvm-compile-time-tracker.com/compare.php?from=f9b12955f891bb086d12309d89656821d776e858&to=0e8df1e93422960640d0efd460212a463700a64a&stat=instructions:u

It looks like there's no notable increase in max-rss
https://llvm-compile-time-tracker.com/compare.php?from=f9b12955f891bb086d12309d89656821d776e858&to=0e8df1e93422960640d0efd460212a463700a64a&stat=max-rss

PR: https://github.com/llvm/llvm-project/pull/211891
DeltaFile
+26-50llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+8-43llvm/lib/Analysis/ScalarEvolution.cpp
+6-3llvm/include/llvm/Analysis/ScalarEvolution.h
+40-963 files

LLVM/project d70004fllvm/test/Transforms/PhaseOrdering scev-custom-dl.ll

fix scev test

Created using spr 1.3.8-wip
DeltaFile
+4-4llvm/test/Transforms/PhaseOrdering/scev-custom-dl.ll
+4-41 files

LLVM/project 40daec8clang/docs ReleaseNotes.md, llvm/docs ReleaseNotes.md

[docs] Remove release notes for backported changes (#212069)

Commit 68f703f3e58a52c41b39dfc654a675560b6c5614 added these release
notes, but this commit was backported to the 23.x release branch in
47e2df730a099583f16fc6fe64f0d2ffc5b7a16a (included in the 23.1.0 RC 1
tag).

Therefore, remove these release notes from the main branch (where they
would have been included in the 24.x release notes).
DeltaFile
+0-3clang/docs/ReleaseNotes.md
+0-3llvm/docs/ReleaseNotes.md
+0-62 files

LLVM/project 2b660e0clang/test/AST/ByteCode virtual-bases.cpp

[clang] [test] Fix a new test on mingw (#212064)

This fixes running a new test that was added in
4b66bacd1fdf02803509b744034f3ab09945157c, in mingw environments.

The quirks that warranted adding the `!defined(_WIN32)` condition in the
test aren't actually specific to Windows in general, but specific to
MSVC environments - mingw environments behave just like other platforms.

Ideally we'd use `!defined(_MSC_VER)`, however in -cc1 mode, Clang
doesn't automatically define `_MSC_VER`; defining it requires setting a
command line option that the driver normally passes in MSVC mode.
Therefore, qualify the condition as `!defined(_MSC_VER) ||
defined(__MINGW32__)`.
DeltaFile
+1-1clang/test/AST/ByteCode/virtual-bases.cpp
+1-11 files

LLVM/project 6aa57c1llvm/lib/CodeGen/SelectionDAG SelectionDAG.cpp, llvm/test/CodeGen/X86 vector-interleaved-load-i16-stride-5.ll

DAG: Canonicalize undef shuffle operands and results to poison

getVectorShuffle canonicalizes fully-undefined results and unused operands.
Make sure these use poison to avoid degrading poison to undef, defending against
future regressions.

Co-Authored-By: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+16-10llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+2-2llvm/test/CodeGen/X86/vector-interleaved-load-i16-stride-5.ll
+18-122 files

LLVM/project fe248b3llvm/lib/Transforms/InstCombine InstCombineCompares.cpp, llvm/test/Transforms/InstCombine cast_ptr.ll

[spr] initial version

Created using spr 1.3.8-wip
DeltaFile
+55-0llvm/test/Transforms/InstCombine/cast_ptr.ll
+20-20llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+75-202 files

LLVM/project 75dff4fllvm/lib/Target/AArch64 AArch64ISelLowering.cpp

[AArch64] Replace some used of SDValue.getNode()-> with direct accesses. NFC (#212099)
DeltaFile
+13-14llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+13-141 files

LLVM/project 653e7b0libc/test/integration/src/pthread pthread_setschedparam_test.cpp CMakeLists.txt

[libc][test][NFC] Fix pthread_setschedparam_test flakiness (#212067)

Synchronised child thread execution in pthread_setschedparam_test using
a mutex lock. This prevents race conditions where the child thread
exited before scheduling parameter assertions ran on multi-core
platforms such as aarch64.

Added missing pthread target dependencies to CMakeLists.txt.

Assisted-by: Automated tooling, human reviewed.
DeltaFile
+25-3libc/test/integration/src/pthread/pthread_setschedparam_test.cpp
+6-1libc/test/integration/src/pthread/CMakeLists.txt
+31-42 files

LLVM/project ed1db56llvm/bindings/ocaml/llvm llvm.mli, llvm/include/llvm/IR Instructions.h InstVisitor.h

[spr] initial version

Created using spr 1.3.8-wip
DeltaFile
+2-113llvm/include/llvm/IR/Instructions.h
+8-14llvm/lib/IR/Instructions.cpp
+3-10llvm/include/llvm/IR/InstVisitor.h
+0-12llvm/unittests/IR/InstructionsTest.cpp
+3-4llvm/bindings/ocaml/llvm/llvm.mli
+16-1535 files

LLVM/project cb078f0llvm/lib/Target/AMDGPU AMDGPURegBankCombiner.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel fshl.ll fshr.ll

[AMDGPU][GISel] Remove redundant AND on scalar shift amounts

A scalar shift only consumes the low log2(bitwidth) bits of its amount,
so an explicit (and amt, mask) feeding the amount is redundant whenever
mask has all of those low bits set. SelectionDAG already achieves this
via SimplifyDemandedBits on the shift-amount operand; this adds the
equivalent to the post-RegBankSelect combiner for G_SHL/G_LSHR/G_ASHR.

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+2,694-3,212llvm/test/CodeGen/AMDGPU/GlobalISel/fshl.ll
+2,512-2,966llvm/test/CodeGen/AMDGPU/GlobalISel/fshr.ll
+224-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankcombiner-redundant-shift-amount-mask.mir
+46-0llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+6-18llvm/test/CodeGen/AMDGPU/GlobalISel/combine-shift-amount-zext.mir
+3-21llvm/test/CodeGen/AMDGPU/GlobalISel/lshr.ll
+5,485-6,2175 files not shown
+5,518-6,27811 files

LLVM/project 5bafce4utils/bazel/llvm-project-overlay/mlir BUILD.bazel

[Bazel] Fixes abd6e74 (#212081)

This fixes abd6e745e22e83af7986cdca4c1ba2d798e00156 (#196613).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=abd6e745e22e83af7986cdca4c1ba2d798e00156

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+1-0utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+1-01 files

LLVM/project 5d582e4llvm/include/llvm/Support GenericLoopInfoImpl.h GenericLoopInfo.h

[LoopInfo] Identify loops with a single-pass DFS algorithm. NFC (#212000)

analyze() numbers the dominator tree, scans it in reverse preorder for
header candidates, floods backward through the CFG from each header's
latches, then walks the CFG again to order the blocks.

Do all of it in one forward DFS, with the algorithm of Wei et al.,
"A New Algorithm for Identifying Loops in Decompilation", which
GenericCycleInfo already implements.

On an irreducible CFG that algorithm may return an irreducible superset
of the natural loop subset `discoverAndMapSubloop` would return.
(Depending on the successor visiting order, the algorithm may report a
reducible loop nested in an irreducible loop, where the reducible one
exactly matches `discoverAndMapSubloop`.)

To satisfy verifyLoop and LoopSimplify, reduce each such ireducible loop
to the natural loop of its header's backedges instead: the latches the
header dominates, and the blocks reaching them without passing the

    [6 lines not shown]
DeltaFile
+222-87llvm/include/llvm/Support/GenericLoopInfoImpl.h
+0-10llvm/include/llvm/Support/GenericLoopInfo.h
+222-972 files

LLVM/project 545f9faclang/lib/AST/ByteCode Compiler.cpp Compiler.h, clang/test/AST/ByteCode constexpr-steps.cpp

[clang][bytecode] Don't check global variable init size (#212092)

The current interpreter doesn't do this either. If we do, the clang
build fails because AMDGPUGenGlobalISel.inc: contains a global constexpr
array called MatchTable0 with 1'926'005 elements.
DeltaFile
+14-0clang/test/AST/ByteCode/constexpr-steps.cpp
+5-3clang/lib/AST/ByteCode/Compiler.cpp
+1-1clang/lib/AST/ByteCode/Compiler.h
+20-43 files

LLVM/project 4eeff3elibcxx/include math.h cmath, libcxx/test/libcxx/numerics/c.math constexpr-cxx23-gcc.pass.cpp constexpr-cxx23-clang.pass.cpp

[libc++][math] Add `constexpr` to `std::fpclassify` (#210993)

Adds `constexpr` to `std::fpclassify` as required by
[P0533R9](https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf).

Towards https://github.com/llvm/llvm-project/issues/105174. Follows-up
8889a3d3b5154d7d5bd4e58ab10d3df503544742.
DeltaFile
+79-0libcxx/test/std/numerics/c.math/fpclassify.pass.cpp
+32-8libcxx/include/math.h
+3-3libcxx/test/libcxx/numerics/c.math/constexpr-cxx23-gcc.pass.cpp
+3-3libcxx/test/libcxx/numerics/c.math/constexpr-cxx23-clang.pass.cpp
+1-1libcxx/include/cmath
+118-155 files

LLVM/project 3fd07e3clang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode] Only override constant-context state if we have an EvalEmitter (#211475)

This does not make sense when emitting bytecode, as the bytecode would
just contain a `PushCC`/`PopCC` pair with nothing in between.
DeltaFile
+8-4clang/lib/AST/ByteCode/Compiler.cpp
+8-41 files

LLVM/project 6cdc7bdllvm/lib/Target/AArch64 AArch64SchedNeoverseN2.td, llvm/test/tools/llvm-mca/AArch64/Neoverse N2-cas.s

[AArch64] Add CAS instructions to NeoverseN2 schedule model (#211195)

CAS instructions (B, H, W, X variants) are not described in the ARM
Neoverse N2 Software Optimization Guide. There used to be no schedule
model for them, so `llvm-mca` was unable to analyze code containing
these instructions:

    llvm-mca  -mtriple=aarch64 -mcpu=cortex-a78 -mattr=+lse casb.s

    error: found an unsupported instruction in the input assembly
    sequence, use -skip-unsupported-instructions=lack-sched to ignore
    these on the input.

    note: instruction:  casb    w0, w1, [sp]

The patch adds a basic schedule model of 14 cycles (as measured on
Cortex-A78 with llvm-exegesis) and L/S utilized pipelines (this is a
guess, the reality is likely more complicated).
DeltaFile
+86-0llvm/test/tools/llvm-mca/AArch64/Neoverse/N2-cas.s
+12-0llvm/lib/Target/AArch64/AArch64SchedNeoverseN2.td
+98-02 files

LLVM/project 2ad6998.github/workflows libclang-abi-tests.yml

workflows/libclang-abi-tests: Fix missing environment variable (#211959)

This was accidentally removed in
f6af6cedfd2fa731bf323608116d373379838b9a.
DeltaFile
+1-0.github/workflows/libclang-abi-tests.yml
+1-01 files

LLVM/project bab258a.github/workflows release-tasks.yml

workflows/relase-tasks: Fix variable name typo (#211732)
DeltaFile
+1-1.github/workflows/release-tasks.yml
+1-11 files

LLVM/project ae0f00d.github/workflows release-documentation.yml

workflows/release-documentation: Fix variable name typo (#211729)
DeltaFile
+1-1.github/workflows/release-documentation.yml
+1-11 files

LLVM/project 5602aeallvm/lib/Target/AMDGPU AMDGPURegBankLegalize.cpp, llvm/test/CodeGen/AMDGPU llvm.amdgcn.intersect_ray.ll packed-fp32.ll

[AMDGPU][GlobalISel] Fold redundant uniform G_AMDGPU_READANYLANE in RegBankCombiner
DeltaFile
+69-144llvm/test/CodeGen/AMDGPU/llvm.amdgcn.intersect_ray.ll
+60-137llvm/test/CodeGen/AMDGPU/packed-fp32.ll
+80-97llvm/test/CodeGen/AMDGPU/GlobalISel/insertelement.i8.ll
+58-0llvm/test/CodeGen/AMDGPU/GlobalISel/readanylane-combines.mir
+45-1llvm/lib/Target/AMDGPU/AMDGPURegBankLegalize.cpp
+6-10llvm/test/CodeGen/AMDGPU/GlobalISel/mul.ll
+318-3891 files not shown
+322-3937 files

LLVM/project 8def962.github CODEOWNERS

[Github] Add myself and lforg37 as mlir wasmssa codeowners (#212079)

Adding @flemairen6 and @lforg37 as codeowners of WasmSSA

Co-authored-by: Ferdinand Lemaire <flemairen6 at gmail.com>
DeltaFile
+3-0.github/CODEOWNERS
+3-01 files

LLVM/project abd6e74mlir/include/mlir/Dialect/WasmSSA/IR WasmSSAOps.td, mlir/lib/Conversion/RaiseWasm RaiseWasmMLIR.cpp

[MLIR][WasmSSA] Add global_set and select ops (#196613)

Adds two missing ops to the WasmSSA dialect.

- `wasmssa.global_set`
- `wasmssa.select`

---------

Co-authored-by: Ferdinand Lemaire <flscminecraft at gmail.com>
DeltaFile
+65-0mlir/test/Conversion/RaiseWasm/wasm-select-to-arith-select.mlir
+55-0mlir/test/Dialect/WasmSSA/global-invalid.mlir
+43-0mlir/include/mlir/Dialect/WasmSSA/IR/WasmSSAOps.td
+38-0mlir/lib/Dialect/WasmSSA/IR/WasmSSAOps.cpp
+37-0mlir/lib/Conversion/RaiseWasm/RaiseWasmMLIR.cpp
+37-0mlir/test/Dialect/WasmSSA/custom_parser/select.mlir
+275-03 files not shown
+323-09 files

LLVM/project dc26bf5lld/ELF Relocations.cpp, lld/test/ELF x86-64-gotpc-relax-too-far.s

[ELF] Retain .got for revertible no-PIC GOTPCRELX optimization (#212077)

Commit 9d6ec280fc537b55ef8641ea85d3522426bc5766 (2023) sets
GotSection::hasGotOffRel when adjustGotPcExpr returns R_RELAX_GOT_PC,
keeping .got alive for an optimization that X86_64::relaxOnce may
revert.

R_RELAX_GOT_PC_NOPIC (e.g. `addq`) in -no-pie mode has the same issue.
DeltaFile
+16-0lld/test/ELF/x86-64-gotpc-relax-too-far.s
+3-3lld/ELF/Relocations.cpp
+19-32 files

LLVM/project 7af5c42mlir/lib/Dialect/Tosa/IR TosaCanonicalizations.cpp, mlir/test/Dialect/Tosa canonicalize.mlir

[mlir][tosa] Fix mul/intdiv folds crashing on dynamic-shaped results (#212073)

`tosa.mul` and `tosa.intdiv` fold constant splat operands by building a
`DenseElementsAttr` of the result type, which asserts when that type has
a dynamic shape. When the operands are constants but the result type is
dynamic, folding aborted. Guard `mulBinaryFolder` and the `IntDivOp`
splat path on a static result shape, matching the other fold paths in
these ops.

Signed-off-by: Víctor Pérez Carrasco <victor.pc.upm at gmail.com>
DeltaFile
+25-0mlir/test/Dialect/Tosa/canonicalize.mlir
+4-1mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
+29-12 files

LLVM/project 40f8720lld/ELF Thunks.cpp Thunks.h

[ELF] Replace getAArch64ThunkDestVA with Thunk::getDestVA. NFC (#212071)

Suggested by
https://github.com/llvm/llvm-project/pull/209962/changes#r3595552131
DeltaFile
+9-15lld/ELF/Thunks.cpp
+2-0lld/ELF/Thunks.h
+11-152 files

LLVM/project a8a36f1llvm/lib/Transforms/Vectorize VPlan.cpp VPlanHelpers.h

[LV] Extract fixupHeaderPhiBackedges from VPlan::execute (NFC) (#212063)

Hoist the header-phi backedge fixup loop at the end of VPlan::execute
into a helper VPTransformState::fixupHeaderPhiBackedges.
DeltaFile
+22-18llvm/lib/Transforms/Vectorize/VPlan.cpp
+5-0llvm/lib/Transforms/Vectorize/VPlanHelpers.h
+27-182 files

LLVM/project 0a7d5c7llvm/test/CodeGen/Hexagon swp-epilog-phi12.mir

[Hexagon] Fix missing requires assert for swp-epilog-phi12.mir (#212062)
DeltaFile
+1-0llvm/test/CodeGen/Hexagon/swp-epilog-phi12.mir
+1-01 files

LLVM/project 01e63aaclang/test/OffloadTools/clang-linker-wrapper linker-wrapper.c linker-wrapper-hip-no-rdc.c, clang/test/OffloadTools/clang-offload-bundler basic.c zlib.c

clang/AMDGPU: Migrate clang-linker-wrapper tests to amdgpu triples (15)

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+59-59clang/test/OffloadTools/clang-offload-bundler/basic.c
+33-33clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper.c
+21-21clang/test/OffloadTools/clang-offload-bundler/zlib.c
+16-16clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper-hip-no-rdc.c
+13-13clang/test/OffloadTools/clang-offload-bundler/zstd.c
+8-8clang/test/OffloadTools/clang-offload-bundler/asserts-on.c
+150-1504 files not shown
+158-15810 files

LLVM/project 1c7cd7fclang/test/CodeGen link-builtin-bitcode.c, clang/test/CodeGenCUDA link-builtin-bitcode-denormal-fp-mode.cu

clang/AMDGPU: Rename amdgcn triples to amdgpu in cc1 tests (14)

Replace the legacy amdgcn architecture name with amdgpu in various
test triples. This set of updates covers cases that did not have
a set -target-cpu.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+12-21clang/test/CodeGenCUDA/link-builtin-bitcode-denormal-fp-mode.cu
+11-11clang/test/Misc/amdgcn.languageOptsOpenCL.cl
+10-10clang/test/CodeGenOpenCL/amdgpu-sizeof-alignof.cl
+10-10clang/test/CodeGen/link-builtin-bitcode.c
+8-8clang/test/CodeGenOpenCL/sqrt-fpmath.cl
+8-8clang/test/Headers/openmp_device_math_isnan.cpp
+59-68261 files not shown
+485-495267 files