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

LLVM/project 014621elibcxx/include/__vector vector.h, libcxx/test/benchmarks/containers/sequence sequence_container_benchmarks.h

[libc++] Implement single element vector::insert in terms of emplace (#210284)

This also ports an optimization to `emplace`: if we copy/move construct
the element we can avoid constructing a temporary.
DeltaFile
+126-6libcxx/test/benchmarks/containers/sequence/sequence_container_benchmarks.h
+8-45libcxx/include/__vector/vector.h
+134-512 files

LLVM/project e5cd86c.github/workflows libcxx-benchmark-cron.yml

[libc++] Revert extra-attempts to original value (#218416)

This reverts ab4cccdf16 now that lnt.llvm.org is stable, the bots have
caught up and all machines have data for all the commits.
DeltaFile
+1-1.github/workflows/libcxx-benchmark-cron.yml
+1-11 files

LLVM/project 0fa5bccclang/lib/AST/ByteCode Compiler.cpp

[clang][bytecode] Avoid an APFloat copy (#218391)
DeltaFile
+2-4clang/lib/AST/ByteCode/Compiler.cpp
+2-41 files

LLVM/project 3c174c7llvm/lib/CodeGen/GlobalISel CombinerHelper.cpp

[GlobalISel][NFC] Remove incorrect attempt to find fewest uses (#218037)

When folding: `(fadd (fma x, y, (fmul u, v)), z) -> (fma x, y, (fma u,
v, z))` remove code that was looking for the addend with the fewest uses
in an expression of the form `(fadd (fmul u, v), (fmul x, y))`. This is
a mismatch and also subsequent code already only allows optimization if
the fma and fmul each have only one non-debug use.

Also fix incorrect comment when looking for the operand with fewest uses
in (fsub (fmul u, v), (fmul x, y)).

---------

Signed-off-by: John Lu <John.Lu at amd.com>
DeltaFile
+1-9llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
+1-91 files

LLVM/project 3981c6bllvm/include/llvm/Analysis AssumptionCache.h, llvm/lib/Analysis AssumptionCache.cpp

Revert "[AssumptionCache] Limit the number of assumptions inspected p… (#218390)

Reverts llvm/llvm-project#217525

A new check introduced in a frequently executed code path affected the
build performance.
DeltaFile
+18-51llvm/lib/Analysis/AssumptionCache.cpp
+0-37llvm/test/Analysis/AssumptionCache/max-assumes-per-value.ll
+0-15llvm/include/llvm/Analysis/AssumptionCache.h
+1-1llvm/lib/Transforms/Utils/CodeExtractor.cpp
+19-1044 files

LLVM/project 2069346llvm/lib/Analysis ModuleSummaryAnalysis.cpp

[ModuleSummary] Only compute BFI if function has profile data (#218374)

After b30971c4bb3f0654fa4fbb242126376169ae66d0 the module summary should
no longer need BFI for functions without profiling data.

Not computing it is a minor compile-time improvement.
DeltaFile
+10-8llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+10-81 files

LLVM/project 4cf50d2bolt/test/RISCV call-link-register.s

[BOLT][RISCV] Precommit test for a call that links through t0 (#218396)

The machine outliner calls its outlined functions with "call t0, func"
and the callee returns with "jr t0". BOLT currently rewrites that call
to link through ra, which the CHECK lines below pin down.
DeltaFile
+34-0bolt/test/RISCV/call-link-register.s
+34-01 files

LLVM/project 3ba9584llvm/lib/Target/SystemZ SystemZAsmPrinter.cpp, llvm/test/CodeGen/SystemZ zos-no-personality.ll

[SystemZ][z/OS] Fix crash when personality function is null (#217947)

When the personality function is specified as `null`, then the current
code triggers an assertion. The correct behaviour, like on Linux, is to
not emit the DWARF EH data and the reference to the personality
function.
DeltaFile
+19-0llvm/test/CodeGen/SystemZ/zos-no-personality.ll
+7-7llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
+26-72 files

LLVM/project b28db57llvm/include/llvm/MC MCSymbolGOFF.h, llvm/lib/MC MCGOFFStreamer.cpp MCSymbolGOFF.cpp

[SystemZ][z/OS] Support emitting common symbols in HLASM (#215278)

This is a follow-up to #210179. It reuses the logic to emit common
symbols in HLASM, too.
DeltaFile
+23-0llvm/lib/MC/MCSymbolGOFF.cpp
+2-20llvm/lib/MC/MCGOFFStreamer.cpp
+12-2llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.cpp
+7-0llvm/include/llvm/MC/MCSymbolGOFF.h
+5-0llvm/test/CodeGen/SystemZ/zos-common-global.ll
+1-1llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMAsmStreamer.h
+50-236 files

LLVM/project be7eff9llvm/include/llvm/Analysis MemoryBuiltins.h, llvm/lib/Analysis MemoryBuiltins.cpp BasicAliasAnalysis.cpp

[BasicAA] Remove special malloc handling (#197180)

We currently assume that allocation functions don't ModRef other memory.
However, this is something that should be controlled by the `memory`
attribute on the allocator, which is typically inaccessiblememonly for
things like malloc.

This code path specifically only affected hardcoded allocation functions
from MemoryBuiltins (not those using allocator attributes). Nowadays,
these are only the `operator new` family functions.

For those functions, we should not unconditionally assume that they
don't access other memory: They are replaceable global allocators, which
in principle can have arbitrary memory effects (they can just be
pair-wise elided, but must be respected if not elided.)

https://github.com/llvm/llvm-project/pull/217652 changed clang to emit
`memory(inaccessiblemem: readwrite, errnomem: write)` for `operator new`
if `-fassume-sane-operator-new` is used (which is the default). We
should not make any additional assumptions in BasicAA if the attribute
is not present.
DeltaFile
+0-14llvm/lib/Analysis/BasicAliasAnalysis.cpp
+14-0llvm/test/Analysis/BasicAA/new.ll
+0-8llvm/lib/Analysis/MemoryBuiltins.cpp
+0-5llvm/include/llvm/Analysis/MemoryBuiltins.h
+1-1llvm/test/Transforms/GVN/nonescaping.ll
+15-285 files

LLVM/project e3ca61fllvm/include/llvm/TargetParser AMDGPUTargetParser.h, llvm/lib/TargetParser AMDGPUTargetParser.cpp

AMDGPU: Deprecate getArchAttrAMDGCN (#217769)

The legacy ArchFeatureKind bitfield returned by getArchAttrAMDGCN is
being replaced by getFeatureBitset (FEAT_* bits). All in-tree callers have
been migrated, so mark both overloads LLVM_DEPRECATED to steer out of 
tree code to the bitset API before the accessor is removed.

Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
DeltaFile
+4-0llvm/include/llvm/TargetParser/AMDGPUTargetParser.h
+2-1llvm/lib/TargetParser/AMDGPUTargetParser.cpp
+6-12 files

LLVM/project 519f6c1llvm/lib/Transforms/IPO FunctionAttrs.cpp, llvm/test/Transforms/FunctionAttrs nofree.ll

[FunctionAttrs] Handle nofreeobj (#218364)

This adds handling for nofreeobj (introduced in
https://github.com/llvm/llvm-project/pull/206445) in two places:

* Don't infer `nofree` if we already have `nofreeobj`. `nofreeobj` is a
stronger property, it's pointless to have both.
 * Use `nofreeobj` on call arguments when inferring `nofree`.
DeltaFile
+22-3llvm/test/Transforms/FunctionAttrs/nofree.ll
+4-2llvm/lib/Transforms/IPO/FunctionAttrs.cpp
+26-52 files

LLVM/project 5806419llvm/test/tools/llvm-mca/AArch64/Cortex C1Ultra-streaming-sme-only-instructions.s C1Ultra-sve-instructions.s

[AArch64] Extend llvm-mca input tests (#217036)

Add extra coverage to tests for AArch64 llvm-mca
DeltaFile
+2,421-285llvm/test/tools/llvm-mca/AArch64/Cortex/A57-forwarding.s
+89-0llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-sve2p1-instructions.s
+0-71llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-sve-sme-instructions.s
+18-2llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-sve-instructions.s
+18-2llvm/test/tools/llvm-mca/AArch64/Cortex/C1Nano-sve-instructions.s
+15-1llvm/test/tools/llvm-mca/AArch64/Cortex/C1Ultra-streaming-sme-only-instructions.s
+2,561-36145 files not shown
+2,817-41051 files

LLVM/project c6b2b84llvm/include/llvm/Analysis AssumptionCache.h, llvm/lib/Analysis AssumptionCache.cpp

Revert "[AssumptionCache] Limit the number of assumptions inspected per value…"

This reverts commit 904188e382f658886ab2c37ded5e54aa72c2eadd.
DeltaFile
+18-51llvm/lib/Analysis/AssumptionCache.cpp
+0-37llvm/test/Analysis/AssumptionCache/max-assumes-per-value.ll
+0-15llvm/include/llvm/Analysis/AssumptionCache.h
+1-1llvm/lib/Transforms/Utils/CodeExtractor.cpp
+19-1044 files

LLVM/project 74609edclang/lib/Sema SemaDeclCXX.cpp, clang/test/SemaCXX uninitialized.cpp

[Clang][Sema] Don't warn on accessing virtual base from abstract class (#217715)

Virtual bases are initialized by the most derived class, and they come
before non-virtual base class initializers. So an abstract class can
assume that virtual bases are already initialized by the time their
constructor runs.

It seems that the warning generally doesn't take indirect bases into
account, otherwise this would become a bit more complicated.

Fixes #204858.
DeltaFile
+18-0clang/test/SemaCXX/uninitialized.cpp
+6-1clang/lib/Sema/SemaDeclCXX.cpp
+24-12 files