LLVM/project 80abec1utils/bazel/llvm-project-overlay/llvm BUILD.bazel

[Bazel] Fixes 7d1bd91 (#218443)

This fixes 7d1bd911e6218b4e02bb813251849d75be9b68f7 (#215648).

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

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

LLVM/project ab30eb5llvm/lib/Transforms/Vectorize LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize/AArch64 scalable-alloca.ll

[LV] Fix crash when forced UserVF and EpilogueVF are ignored (#218282)

`computeBestVF()` assumes/asserts that there should be only 2 vplans as
long as there is a vplan for `UserVF` and when `EpilogueVF` is forced. 
It doesn't consider the case when those VFs are ignored because of
invalid costs.

This patch removes the assert and add a check for the vplan size.
DeltaFile
+1-2llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+1-1llvm/test/Transforms/LoopVectorize/AArch64/scalable-alloca.ll
+2-32 files

LLVM/project 35efd5dflang/lib/Optimizer/Transforms AddDebugInfo.cpp, flang/test/Integration debug-line-directives-only.f90

[flang][debug] Don't ask for a name table with -gline-directives-only (#218402)

On current main (since #217132), a unit built with
`-gline-directives-only` crashes the backend when DWARF 5 is requested:

```console
$ echo 'end program' > test.f90
$ flang -gdwarf-5 -gline-directives-only -S -o /dev/null test.f90
flang: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.h:107:
llvm::MCSymbol *llvm::DwarfUnit::getLabelBegin() const:
Assertion `LabelBegin && "LabelBegin is not initialized"' failed.
```

The version has to be spelled out because flang does not yet default to
DWARF 5. Everything else about the command line is ordinary.

Such a unit emits line directives and no `.debug_info`, so the header of
its compile unit is never written and neither is the label that header
defines. Under DWARF 5 the accelerator table indexes every compile unit

    [11 lines not shown]
DeltaFile
+10-2flang/lib/Optimizer/Transforms/AddDebugInfo.cpp
+10-0flang/test/Integration/debug-line-directives-only.f90
+1-1flang/test/Transforms/debug-line-table.fir
+21-33 files

LLVM/project f41d0ccllvm/include/llvm/Support KnownFPClass.h, llvm/lib/Analysis ValueTracking.cpp

[KnownFPClass] Move float-to-integer bitcast handling into KnownFPClass [NFC] (#218090)

I moved the float-to-integer bitcast code into a new `KnownBits
bitcastToKnownBits(const fltSemantics &FltSemantics) const;` function.
This allows the code to be unit testable, and allows the code to be
reused elsewhere.

I also have future plans to work on the `KnownBits` deductions for the
float-to-integer bitcast.

AI Disclosure:
I used ChatGPT Codex (sol-5.6) to help move the code which I reviewed.
DeltaFile
+33-0llvm/lib/Support/KnownFPClass.cpp
+1-27llvm/lib/Analysis/ValueTracking.cpp
+3-0llvm/include/llvm/Support/KnownFPClass.h
+37-273 files

LLVM/project 0b0c62fclang/lib/CodeGen CGDebugInfo.cpp, clang/test/DebugInfo/Generic attr-nodebug2.c

[Debug Info] Fix a Verifier failure with redeclared nodebug functions  (#218070)

When a forward-declard function is used before its definition, and the
definition has a nodebug attribute on it, the existing heuristic in
EmitFuncDeclForCallSite would fail, because it only saw the non-nodebug
forward declaration, thus emitting a conflicting DISubprogram for the
call site.

rdar://184780682

Assisted-by: claude
DeltaFile
+19-0clang/test/DebugInfo/Generic/attr-nodebug2.c
+7-2clang/lib/CodeGen/CGDebugInfo.cpp
+26-22 files

LLVM/project 42494aellvm/lib/Target/AMDGPU AMDGPUUniformIntrinsicCombine.cpp, llvm/test/CodeGen/AMDGPU redundant-ballot-reads.ll

[AMDGPU] Combine redundant ballot intrinsic calls

Suppose there is a loop where there is a call to @llvm.amdgcn.ballot,
which maps to an instruction involving the exec mask as an operand. This
instruction duplicates if the loop is unrolled. With a higher number of
unrolled iterations, the code bloats with such redundant instructions
with $exec as there is no middle-end/backend pass which could combine
such instructions in a uniform CFG.

This patch introduces a transform in AMDGPUUniformIntrinsicCombine to
combine redundant calls to @llvm.amdgcn.ballot, to mitigate this issue.

The approach is to walk over the dominator tree and collect all calls to
@llvm.amdgcn.ballot. Map the result type and condition to the calls, to
avoid combining calls of different kinds. Calls A and B can be combined
into A iff:
- A and B are identical
- A dominates B
- all paths from A to B are uniform and exec-invariant.

    [2 lines not shown]
DeltaFile
+448-0llvm/test/CodeGen/AMDGPU/redundant-ballot-reads.ll
+165-5llvm/lib/Target/AMDGPU/AMDGPUUniformIntrinsicCombine.cpp
+613-52 files

LLVM/project 2666f4cllvm/include/llvm/Transforms/Utils BasicBlockUtils.h, llvm/lib/Transforms/Utils BasicBlockUtils.cpp

[Transforms][Utils] Remove unused hasOnlySimpleTerminator (#218334)

The last use was removed on Nov 3, 2025 in
commit a8ea7f4580b467183ce2075db6b1b2ec3beb6ebf.
DeltaFile
+0-9llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+0-4llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h
+0-132 files

LLVM/project 50d29a7clang/www cxx_dr_status.html

[clang] Update C++ DR status page (#218432)
DeltaFile
+234-192clang/www/cxx_dr_status.html
+234-1921 files

LLVM/project 902c282llvm/lib/Support KnownFPClass.cpp, llvm/test/Transforms/Attributor nofpclass-trig.ll

[KnownFPClass] Improve sign-preservation for `asin` (#216119)

`asin(x)` is negative iff `x` is negative. However, this can be loosened
to `asin(x)` is negative iff `x` is negative-finite since `asin(-inf)`
is `NaN`.
DeltaFile
+10-0llvm/test/Transforms/Attributor/nofpclass-trig.ll
+3-3llvm/lib/Support/KnownFPClass.cpp
+13-32 files

LLVM/project e64507bllvm/tools/remarks-shlib CMakeLists.txt

[Remarks] Fix linker warnings from mold

This PR is trying to fix the linker warnings emitted from mold.

```
mold: warning: tools/remarks-shlib/Remarks.exports: cannot assign version `LLVM_24.0` to symbol `LLVMRemarkStringGetData`: symbol not found
```

Fixes #93028.
DeltaFile
+19-1llvm/tools/remarks-shlib/CMakeLists.txt
+19-11 files

LLVM/project 01079d2flang-rt/lib/runtime CMakeLists.txt, flang/test/Lower/OpenMP omp-lib-integer-wrappers.f90

[OpenMP][Flang] Add integer-kind wrappers to omp_lib (#213505)

Many OpenMP routines in omp_lib currently accept only
integer(kind=omp_integer_kind) arguments, where omp_integer_kind maps to
c_int. As a result, Flang's type checking rejects calls that pass
integer(1), integer(2), or integer(8) arguments. To improve
compatibility, wrapper procedures have been added in the omp_lib module
for applicable routines, enabling support for integer(1), integer(2),
integer(4), and integer(8) argument types. The interfaces are added in
omp_lib module and the implementations are part of omp_lib_impl sub
module.

Similar changes are required in omp_lib.h and will be addressed in a
separate pull request.

Fixes #123948.

Assisted-by: Cursor

Co-authored-by: Cursor <cursoragent at cursor.com>
DeltaFile
+579-47openmp/module/omp_lib.F90.var
+465-0openmp/module/omp_lib_impl.F90.var
+237-0flang/test/Lower/OpenMP/omp-lib-integer-wrappers.f90
+37-2openmp/module/CMakeLists.txt
+12-0flang-rt/lib/runtime/CMakeLists.txt
+1-1openmp/runtime/cmake/LibompExports.cmake
+1,331-502 files not shown
+1,334-518 files

LLVM/project 7d1bd91flang/include/flang/Semantics openmp-modifiers.h, flang/lib/Semantics openmp-modifiers.cpp

[OpenMP][flang] Use auto-generated data for modifier verification (#215648)

Introduce descriptors of OpenMP clauses and modifiers, auto-generated
from OpenMP specification data[*].

This replaces the preexisting modifier descriptors used in flang, the
code using it is adjusted to use the new definitions.

[*] This does not contain any actual auto-generation infrastructure. The
descriptors were generated by a custom script from the exported OpenMP
definitions.
DeltaFile
+2,386-0llvm/lib/Frontend/OpenMP/OMPDescriptors.inc
+0-823flang/lib/Semantics/openmp-modifiers.cpp
+155-116flang/include/flang/Semantics/openmp-modifiers.h
+127-0llvm/include/llvm/Frontend/OpenMP/OMPDescriptors.h.inc
+117-0llvm/include/llvm/Frontend/OpenMP/OMPDescriptors.h
+80-0llvm/lib/Frontend/OpenMP/OMPDescriptors.cpp
+2,865-93926 files not shown
+2,985-1,06332 files

LLVM/project 7538d21llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp, llvm/test/CodeGen/X86 usubsat-narrow.ll

[DAGCombiner] Fix divide-by-zero in visitSUBSAT when LHS is known-zero (#218284)

Fixes a crash introduced by #206592.

When the LHS of `usub.sat` is a known-zero value, `ActiveBits` is 0 and
`NarrowBits` starts at 0, causing a divide-by-zero via `ActiveBits %
NarrowBits` in `visitSUBSAT`.

Guard the loop with `NarrowBits != 0` to skip the narrowing optimization
in this case. Other folds handle the known-zero
case correctly.

A regression test has been added to `usubsat-narrow.ll` using a
known-zero LHS (`xor v, v`) to prevent future regressions.

Fixes #217964
DeltaFile
+27-0llvm/test/CodeGen/X86/usubsat-narrow.ll
+1-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+28-12 files

LLVM/project 519749allvm/lib/Analysis ScalarEvolution.cpp

[SCEV] Remove unused MaxPhiSCCAnalysisSize option (NFC) (#218421)

The -scalar-evolution-max-scc-analysis-depth is not used, remove it.
DeltaFile
+0-6llvm/lib/Analysis/ScalarEvolution.cpp
+0-61 files

LLVM/project 098b2bbmlir/lib/Dialect/Bufferization/Transforms BufferizableOpInterfaceImpl.cpp, mlir/test/Dialect/Bufferization/Transforms one-shot-bufferize.mlir

[mlir][bufferization] Fix alloc_tensor copy operand assert with size_hint (#217734)

`AllocTensorOpInterface::bufferizesToMemoryRead` and
`bufferizesToMemoryWrite` assert that the `copy` operand is the last
operand. The ODS argument order is `dynamic_sizes`, `copy`, `size_hint`,
`memory_space`.

`copy` and `size_hint` can be used together, so the input is legal and
thus OSB asserts on legal code. Compare the operand against `getCopy()`
instead.

---

Code authored by Claude Code.

Signed-off-by: Víctor Pérez Carrasco <victor.pc.upm at gmail.com>
DeltaFile
+15-0mlir/test/Dialect/Bufferization/Transforms/one-shot-bufferize.mlir
+2-2mlir/lib/Dialect/Bufferization/Transforms/BufferizableOpInterfaceImpl.cpp
+17-22 files

LLVM/project 887442cmlir/lib/Dialect/Tensor/Transforms BufferizableOpInterfaceImpl.cpp, mlir/test/Dialect/Tensor bufferize.mlir

[mlir][tensor] Fix assertion on bufferizing expand_shape with a non-strided layout (#217714)

`ExpandShapeOpInterface::bufferize` creates a `memref.expand_shape`
directly without consulting `getBufferType`. The `memref::ExpandShapeOp`
builder computes the result layout with `computeExpandedType` and
asserts when that fails. `computeExpandedType` fails when the source
layout is not identity and `getStridesAndOffset` cannot decompose it, so
a non-strided affine layout aborts the compiler instead of reporting a
failed bufferization.

Query `getBufferType` first and return failure when it fails. The
model's own `getBufferType` already propagates the `computeExpandedType`
failure.

Rest of the behaviour is unchanged: we just fail gracefully now instead
of crashing.

---

Code authored by Claude Code.
DeltaFile
+35-1mlir/test/Dialect/Tensor/bufferize.mlir
+5-2mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
+40-32 files

LLVM/project 3a8697fclang/include/clang/StaticAnalyzer/Core/PathSensitive ExplodedGraph.h CheckerContext.h, clang/lib/StaticAnalyzer/Core CoreEngine.cpp CheckerManager.cpp

[NFC][analyzer] Remove class 'NodeBuilder' (#217319)

This change concludes the removal of the class `NodeBuilder` which
previously added lots of unnecessary complications to the logic of the
analyzer engine.

The main feature of a `NodeBuilder` was that it tracked a "frontier"
set of exploded nodes, which were freshly created and not yet superseded
by the creation of another node. This was counterproductive in almost all
code that used `NodeBuilder`s -- with the exception of `CheckerContext`
where this was useful to support arbitrary chains of `addTransition`
calls in checkers.

As earlier commits removed the counterproductive use of `NodeBuilder`s,
there was only one surviving `NodeBuilder`, a data member of
`CheckerContext`, and its `generateNode` method was called only once, so
this commit inlines still relevant fragments of `NodeBuilder` into
`CheckerContext` and removes `NodeBuilder` as a separate class.


    [4 lines not shown]
DeltaFile
+58-51clang/lib/StaticAnalyzer/Core/CheckerManager.cpp
+0-92clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h
+19-19clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h
+0-11clang/lib/StaticAnalyzer/Core/CoreEngine.cpp
+0-1clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h
+77-1745 files

LLVM/project da3ea31clang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode] Avoid copying function call arguments (#218399)

In most cases, we dony' need the SmallVector (we only use it to reverse
the arguments in the assignment operator case).
DeltaFile
+6-3clang/lib/AST/ByteCode/Compiler.cpp
+6-31 files

LLVM/project c7a7180clang-tools-extra/clang-tidy/modernize UseNoexceptCheck.cpp, clang-tools-extra/docs ReleaseNotes.md

[clang-tidy] Fix modernize-use-noexcept crash on unparsed exception specs (#218256)

A failed template instantiation can leave a function type with an
`EST_Unparsed` exception specification.
`modernize-use-noexcept` currently calls
`FunctionProtoType::isNothrow()` for that type, which reaches an
unreachable path in `FunctionProtoType::canThrow()`.

This fixes the crash by skipping unparsed exception specifications
before querying whether the function is non-throwing.

Fixes #214291
DeltaFile
+12-0clang-tools-extra/test/clang-tidy/checkers/modernize/use-noexcept-unparsed-exception-spec.cpp
+4-0clang-tools-extra/docs/ReleaseNotes.md
+2-1clang-tools-extra/clang-tidy/modernize/UseNoexceptCheck.cpp
+18-13 files

LLVM/project e43dcc8clang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode] Avoid classifying the same expression three times (#218403)
DeltaFile
+4-3clang/lib/AST/ByteCode/Compiler.cpp
+4-31 files

LLVM/project fa7780cllvm/include/llvm/IR Intrinsics.td, llvm/test/Analysis/BasicAA cs-cs.ll

[IR] Use default attributes for unordered memcpy/memset (#218409)

All the default attributes (willreturn, nosync, nofree, nocallback)
apply to these, so make them DefaultAttrsIntrinsics.

This was raised in
https://github.com/llvm/llvm-project/pull/204795#issuecomment-4937647710.
DeltaFile
+20-20llvm/test/Analysis/BasicAA/cs-cs.ll
+12-16llvm/include/llvm/IR/Intrinsics.td
+32-362 files

LLVM/project 399561cllvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.h SPIRVNonSemanticDebugHandler.cpp, llvm/test/CodeGen/SPIRV/debug-info debug-function-declaration-namespace-scope.ll debug-function-namespace-scope.ll

Add support for DebugLexicalBlock.
DeltaFile
+123-5llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+61-0llvm/test/CodeGen/SPIRV/debug-info/debug-lexical-block.ll
+48-0llvm/test/CodeGen/SPIRV/debug-info/debug-lexical-block-namespace.ll
+31-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+9-6llvm/test/CodeGen/SPIRV/debug-info/debug-function-namespace-scope.ll
+9-4llvm/test/CodeGen/SPIRV/debug-info/debug-function-declaration-namespace-scope.ll
+281-156 files

LLVM/project 5d4debebolt/test/RISCV cond-tail-call.s

[BOLT][RISCV] Precommit test for a conditional branch to end of the function (#218419)
DeltaFile
+40-0bolt/test/RISCV/cond-tail-call.s
+40-01 files

LLVM/project 8a356a1clang/lib/AST/ByteCode Context.h Context.cpp

[clang][bytecode] Optimize canClassify/classify (#218397)

Always get the canonical type and handle some more builtin types in
canClassify().
DeltaFile
+3-5clang/lib/AST/ByteCode/Context.cpp
+2-1clang/lib/AST/ByteCode/Context.h
+5-62 files

LLVM/project a4cc3edllvm/lib/Target/SPIRV SPIRVNonSemanticDebugHandler.h SPIRVNonSemanticDebugHandler.cpp, llvm/test/CodeGen/SPIRV/debug-info debug-function-declaration-namespace-scope.ll debug-function-namespace-scope.ll

Add support for DebugLexicalBlock.
DeltaFile
+123-5llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.cpp
+61-0llvm/test/CodeGen/SPIRV/debug-info/debug-lexical-block.ll
+48-0llvm/test/CodeGen/SPIRV/debug-info/debug-lexical-block-namespace.ll
+36-0llvm/lib/Target/SPIRV/SPIRVNonSemanticDebugHandler.h
+9-6llvm/test/CodeGen/SPIRV/debug-info/debug-function-namespace-scope.ll
+9-4llvm/test/CodeGen/SPIRV/debug-info/debug-function-declaration-namespace-scope.ll
+286-156 files

LLVM/project e4c6b06clang/lib/AST/ByteCode Pointer.h

[clang][bytecode] Optimize `PtrView::isOnePastEnd()` (#218375)

We call this a lot. Optimize this by inlining and then simplifying the
callers, i.e. don't call getFieldDesc() as much.

Also remove some code duplication from the similar
`Pointer::isOnePastEnd()`.
DeltaFile
+15-6clang/lib/AST/ByteCode/Pointer.h
+15-61 files

LLVM/project 7e0fc20mlir/lib/Dialect/Linalg/IR LinalgOps.cpp, mlir/test/Dialect/Linalg canonicalize.mlir

[mlir][linalg] Fix splat fold crash on non-TypedAttr element types (#218012)

`getScalarConstantAttrFromDenseSplat` returns
`getSplatValue<TypedAttr>()`, which for a derived attribute type is an
unchecked `llvm::cast`. Complex element types store their splat as an
`ArrayAttr` of two values, and `ArrayAttr` does not implement
`TypedAttr`, so the cast asserts on

    %cst = arith.constant dense<(1.0,2.0)> : tensor<3xcomplex<f32>>
    %0   = linalg.broadcast ins(%cst : tensor<3xcomplex<f32>>)
            outs(%init : tensor<2x3xcomplex<f32>>) dimensions = [0]

under `mlir-opt --canonicalize`. Integer and float splats yield
`IntegerAttr`/`FloatAttr`, which are `TypedAttr`, so only non-scalar
element types are affected.

Guard with a `dyn_cast` and decline the fold when the splat value has no
`TypedAttr` representation. The helper is shared by the broadcast
pattern added in PR 195980 and the transpose patterns added in PR
195991, so both call sites are fixed; a test is added for each, as the
transpose case was not previously covered.
DeltaFile
+34-0mlir/test/Dialect/Linalg/canonicalize.mlir
+7-1mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
+41-12 files

LLVM/project 2b66027clang/lib/AST/ByteCode Compiler.h Compiler.cpp

[clang][bytecode][NFC] Remove unnecessary rvalue reference parameters (#218395)

DeclOrExpr is just pointer-sized, so copy them.
DeltaFile
+3-3clang/lib/AST/ByteCode/Compiler.cpp
+2-2clang/lib/AST/ByteCode/Compiler.h
+5-52 files

LLVM/project d1d20adllvm/lib/CodeGen/GlobalISel IRTranslator.cpp, llvm/test/CodeGen/AArch64/GlobalISel irtranslator-one-by-n-vector-ptr-add.ll arm64-irtranslator-gep.ll

[GlobalISel] Avoid redundant copies of GEPs results (#218352)

Improves aarch64-O0-g CTMark geomean -0.09%.

http://llvm-compile-time-tracker.com/compare.php?from=a49d90627bd44d2e76c20b9d4e0cafb339fb806f&to=93d6aa1f114cfe43c4bd7b569cd36f703fa0a9c8&stat=instructions%3Au

Assisted-by: codex
DeltaFile
+6-12llvm/test/CodeGen/AMDGPU/GlobalISel/irtranslator-getelementptr.ll
+6-12llvm/test/CodeGen/AArch64/GlobalISel/translate-gep.ll
+5-10llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-gep-flags.ll
+2-6llvm/test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-gep.ll
+2-4llvm/test/CodeGen/AArch64/GlobalISel/irtranslator-one-by-n-vector-ptr-add.ll
+1-2llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+22-461 files not shown
+23-487 files

LLVM/project c3bb3d8llvm/test/CodeGen/AArch64 early-ifcvt-load-to-cond-br.mir vector-ldst-offset.ll, llvm/test/CodeGen/AMDGPU sad.ll

Merge branch 'main' into users/kparzysz/auto-modifiers-verify
DeltaFile
+9,921-0llvm/test/CodeGen/AArch64/vector-ldst-align-float.ll
+8,227-0llvm/test/CodeGen/AArch64/vector-ldst-align.ll
+3,448-2llvm/test/CodeGen/AArch64/vector-ldst-offset.ll
+2,421-285llvm/test/tools/llvm-mca/AArch64/Cortex/A57-forwarding.s
+1,608-357llvm/test/CodeGen/AMDGPU/sad.ll
+1,629-90llvm/test/CodeGen/AArch64/early-ifcvt-load-to-cond-br.mir
+27,254-734827 files not shown
+56,608-8,710833 files