LLVM/project 72525fbllvm/lib/Transforms/Vectorize VPlanTransforms.cpp VPlanUnroll.cpp

[VPlan] Materialize UF after unrolling (NFCI).

Move materialization of the symbolic UF directly to unrollByUF. At this
point, unrolling materializes the decision and it is natural to also
materialize the symbolic UF here.
DeltaFile
+3-5llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+4-1llvm/lib/Transforms/Vectorize/VPlanUnroll.cpp
+7-62 files

LLVM/project 94ebc8allvm/test/Transforms/LoopVectorize find-last-iv-sinkable-load.ll

[LV] Remove duplicated IV expression sinking tests. (NFC)

Remove duplicated tests already covered by
llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-expr.ll.
DeltaFile
+0-334llvm/test/Transforms/LoopVectorize/find-last-iv-sinkable-load.ll
+0-3341 files

LLVM/project 0b61f15llvm/test/CodeGen/AArch64 fcvt-i256.ll

[AArch64] Add fcvt-i256 test cases. NFC
DeltaFile
+2,157-0llvm/test/CodeGen/AArch64/fcvt-i256.ll
+2,157-01 files

LLVM/project 903acc2clang/lib/CodeGen ItaniumCXXABI.cpp, clang/test/DebugInfo/CXX ptrauth-member-function-pointer-debuglocs.cpp

[AArch64][PAC] Emit `!dbg` locations in `*_vfpthunk_` functions (#179688)

The usage of pointers to member functions with Pointer Authentication
requires generation of `*_vfpthunk_` functions. These thunk functions
can be later inlined and optimized by replacing the indirect call
instruction with a direct one and then inlining that function call.

In absence of `!dbg` metadata attached to the original call instruction,
such inlining ultimately results in an assertion "!dbg attachment points
at wrong subprogram for function" in the assertions-enabled builds. By
manually executing `opt` with `-verify-each` option on the LLVM IR
produced by the frontend, an actual issue can be observed: "inlinable
function call in a function with debug info must have a !dbg location"
after the replacement of indirect call instruction with the direct one
takes place.

This commit fixes the issue by attaching artificial `!dbg` locations to
the original call instruction (as well as most other instructions in
`*_vfpthunk_` function) the same way it is done for other
compiler-generated helper functions.
DeltaFile
+39-0clang/test/DebugInfo/CXX/ptrauth-member-function-pointer-debuglocs.cpp
+4-0clang/lib/CodeGen/ItaniumCXXABI.cpp
+43-02 files

LLVM/project b3be782mlir/lib/Dialect/Affine/IR AffineOps.cpp, mlir/test/Dialect/Affine canonicalize.mlir

[mlir][affine] Fix crash in linearize_index fold when multi-index is ub.poison (#183816)

`AffineLinearizeIndexOp::fold` guarded the constant-folding path with
`llvm::is_contained(adaptor.getMultiIndex(), nullptr)`, which only
catches operands that have not been evaluated at all. When an operand
folds to `ub.PoisonAttr`, the attribute is non-null so the guard passed,
and the subsequent `cast<IntegerAttr>(indexAttr)` call crashed with an
assertion failure.

Fix by replacing the null-only check with one that requires every
multi-index attribute to be a concrete `IntegerAttr`, returning
`nullptr` for any other attribute (including null and PoisonAttr).

Fixes #178204
DeltaFile
+14-0mlir/test/Dialect/Affine/canonicalize.mlir
+6-1mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+20-12 files

LLVM/project f05b705mlir/test/IR visitors.mlir

[mlir] Fix crash in testNoSkipErasureCallbacks on empty blocks (#183757)

The `noSkipBlockErasure` callback in `testNoSkipErasureCallbacks` called
`block->front().getParentRegion()` to get the parent region of a block.
This dereferences the ilist sentinel node when the block has no
operations, triggering an assertion failure.

Use `block->getParent()` instead, which directly returns the region
containing the block without requiring any operations to be present.

Fixes #183511
DeltaFile
+10-0mlir/test/IR/visitors.mlir
+10-01 files

LLVM/project 2456214llvm/lib/ProfileData/Coverage CoverageMapping.cpp, llvm/test/tools/llvm-cov mcdc-macro.test

Restore #125407, Make covmap tolerant of nested Decisions (#183073)

Change(s):

- Suppress range errors in CounterExpr
DeltaFile
+144-174llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+7-7llvm/test/tools/llvm-cov/mcdc-macro.test
+151-1812 files

LLVM/project 7370091mlir/test/IR visitors.mlir, mlir/test/lib/IR TestVisitors.cpp

[mlir][test-ir-visitors] Fix noSkipBlockErasure crash with block args used across blocks (#183828)

The noSkipBlockErasure callback in TestVisitors.cpp dropped uses of op
results within the same region before erasing a block, but did not drop
uses of the block's own arguments (e.g. function entry block arguments).
When the block was subsequently erased its block arguments were
destroyed while their use-lists were still non-empty, triggering the
assertion in IRObjectWithUseList::~IRObjectWithUseList().

Fix this by also iterating over the block's arguments and dropping any
uses that belong to the same parent region. This mirrors the existing
logic for op result uses and makes the block-erasure walk handle IRs
where function arguments are consumed by ops in sibling blocks.

Also replace `block->front().getParentRegion()` with
`block->getParent()` for robustness (avoids UB when the block has no
ops).

Add a regression test based on the reproducer from

    [2 lines not shown]
DeltaFile
+14-1mlir/test/IR/visitors.mlir
+12-1mlir/test/lib/IR/TestVisitors.cpp
+26-22 files

LLVM/project c8e211cmlir/include/mlir/Dialect/Utils ReshapeOpsUtils.h, mlir/lib/Dialect/Tensor/IR TensorOps.cpp

[mlir][tensor] Fix crash in expand_shape fold with dynamic result type (#183785)

`foldReshapeOp` (in `ReshapeOpsUtils.h`) and `FoldReshapeWithConstant`
(in `TensorOps.cpp`) both tried to create a new `DenseElementsAttr`
constant when folding a reshape op whose operand is a constant. Neither
checked that the result type was statically shaped before doing so, but
`DenseElementsAttr::reshape()` and
`DenseElementsAttr::getFromRawBuffer()` both assert `hasStaticShape()`.

Guard both fold paths with a `hasStaticShape()` check so they return
early when the result type contains a dynamic dimension.

Fixes #177845
DeltaFile
+16-0mlir/test/Dialect/Tensor/canonicalize.mlir
+8-3mlir/include/mlir/Dialect/Utils/ReshapeOpsUtils.h
+4-0mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
+28-33 files

LLVM/project b2c92bcllvm/test/MC/ARM dwarf-asm-multiple-sections.s, llvm/test/MC/ELF gen-dwarf.s

[llvm-mc][dwarf] Bump supported version to DWARF 6 (#183779)

Depends on:
* https://github.com/llvm/llvm-project/pull/183838
* https://github.com/llvm/llvm-project/pull/183841
* https://github.com/llvm/llvm-project/pull/183859

Bumps the supported version to 6. Unit header layout hasn't changed
between versions AFAIK, so re-used the DWARF5 `FileCheck` in the test.
This by no means claims full DWARFv6 support, but is handy for testing
DWARFv6 features while full support is being gradually implemented.
DeltaFile
+40-32llvm/test/MC/ARM/dwarf-asm-multiple-sections.s
+6-4llvm/test/MC/ELF/gen-dwarf.s
+1-1llvm/tools/llvm-mc/llvm-mc.cpp
+47-373 files

LLVM/project 3403aacllvm/lib/Analysis CMakeLists.txt

[CMake][LLVM] Disable PCH on Clang for file with custom flags too (#183813)

Precompiled headers are already skipped when building ConstantFolding.cpp with MSVC, they cause problems with Clang too so disable it there the same way.
DeltaFile
+2-0llvm/lib/Analysis/CMakeLists.txt
+2-01 files

LLVM/project 9b1f784llvm/lib/Target/ARM ARMInstrMVE.td ARMISelLowering.cpp, llvm/test/CodeGen/Thumb2 mve-sli-sri.ll

[ARM][MVE] Add SLI and SRI recognition. (#183471)

This uses the newly added code from #182051 to optimize to MVE sli and
sri. The only major difference is the legal types supported, but we also
lower intrinsics via VSLIIMM/VSLIIMM, so that only one tablegen pattern
is needed.
DeltaFile
+6-24llvm/test/CodeGen/Thumb2/mve-sli-sri.ll
+12-12llvm/lib/Target/ARM/ARMInstrMVE.td
+10-2llvm/lib/Target/ARM/ARMISelLowering.cpp
+28-383 files

LLVM/project 8f09282llvm/lib/DebugInfo/DWARF DWARFListTable.cpp, llvm/unittests/DebugInfo/DWARF DWARFListTableTest.cpp

[llvm][DebugInfo] Bump DWARFListTable maximum DWARF version (#183859)

Bumps `.debug_rnglists` maximum supported version to DWARFv6.

This does not mean we officially support DWARFv6. It just enables us
testing the features gradually.

Added unit-test since there was no prior test in the entire LLVM
test-suite that checked this.
DeltaFile
+64-0llvm/unittests/DebugInfo/DWARF/DWARFListTableTest.cpp
+1-1llvm/lib/DebugInfo/DWARF/DWARFListTable.cpp
+65-12 files

LLVM/project ce3460ellvm/lib/DebugInfo/DWARF DWARFDebugLine.cpp, llvm/unittests/DebugInfo/DWARF DWARFDebugLineTest.cpp

[llvm][DebugInfo] Bump DWARFDebugLine maximum DWARF version (#183841)

Bumps `.debug_line` maximum supported version to DWARFv6.

This does not mean we officially support DWARFv6. It just enables us
testing the features gradually.
DeltaFile
+1-1llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+1-1llvm/unittests/DebugInfo/DWARF/DWARFDebugLineTest.cpp
+2-22 files

LLVM/project c40b0b2llvm/include/llvm/DebugInfo/DWARF DWARFContext.h, llvm/test/tools/llvm-dwarfdump/X86 verify_unit_header_chain.s

[llvm][DebugInfo] Bump DWARFContext maximum DWARF version (#183838)

In order to start testing DWARFv6 feature support we need to bump this
version for tooling to work.

This does not mean we officially support DWARFv6. It just enables us
testing the features gradually.
DeltaFile
+5-5llvm/test/tools/llvm-dwp/X86/cu_tu_units_manual_v5_invalid.s
+2-2llvm/test/tools/llvm-symbolizer/split-dwarf-dwp-invalid.test
+1-1llvm/include/llvm/DebugInfo/DWARF/DWARFContext.h
+1-1llvm/test/tools/llvm-dwarfdump/X86/verify_unit_header_chain.s
+9-94 files

LLVM/project ab2908ellvm/test/Transforms/LoopVectorize/AArch64 transform-narrow-interleave-fold-tail.ll transform-narrow-interleave-group-requires-scalar-epilogue.ll, llvm/test/Transforms/LoopVectorize/X86 transform-narrow-interleave-to-widen-memory-live-outs.ll

[LV] Add tail-folding & required scalar epilogue tests for IG narrowing.

Add additional tests to cover missing code paths when narrowing
interleave groups:
 * tail-folding
 * interleave-groups that require a scalar iteration.
DeltaFile
+119-0llvm/test/Transforms/LoopVectorize/X86/transform-narrow-interleave-to-widen-memory-live-outs.ll
+113-0llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-fold-tail.ll
+66-0llvm/test/Transforms/LoopVectorize/AArch64/transform-narrow-interleave-group-requires-scalar-epilogue.ll
+298-03 files

LLVM/project 54fda6dbolt/docs BinaryAnalysis.md

Address other comments
DeltaFile
+39-4bolt/docs/BinaryAnalysis.md
+39-41 files

LLVM/project 108df06clang/lib/AST DeclTemplate.cpp, clang/test/SemaTemplate GH181062.cpp

[clang] Backport: fix transformation of substituted constant template parameters of partial specializations

This fixes a helper so it implements retrieval of the argument replaced
for a template parameter for partial spcializations.

This was left out of the original patch, since it's quite hard to actually test.

This helper implements the retrieval for variable templates, but only for
completeness sake, as no current users rely on this, and I don't think a similar
test case is possible to implement with variable templates.

This fixes a regression introduced in #161029 which will be backported to llvm-22,
so there are no release notes.

Backport from #183348

Fixes #181062
Fixes #181410
DeltaFile
+24-0clang/test/SemaTemplate/GH181062.cpp
+10-10clang/lib/AST/DeclTemplate.cpp
+34-102 files

LLVM/project cb79aaeclang/lib/AST ASTContext.cpp, clang/test/SemaTemplate GH183075.cpp

[clang] Backport: allow canonicalizing assumed template names

Assumed template names are part of error recovery and encode just a
declaration name, making them always canonical. This patch allows
them to be canonicalized, which is trivial.

Backport from #183222

Fixes #183075
DeltaFile
+13-0clang/test/SemaTemplate/GH183075.cpp
+5-2clang/lib/AST/ASTContext.cpp
+18-22 files

LLVM/project ee4e391clang/lib/Sema SemaCXXScopeSpec.cpp, clang/test/SemaCXX GH167120.cpp

[clang] Backport: NestedNameSpecifier typo correction fix

This stops typo correction from considering template parameters
as candidates for a NestedNameSpecifier when it has a prefix itself.

I think this is better than the alternative of accepting these candidates,
but otherwise droping the prefix, because it seems more far-fetched that
someone would actually try to refer to a template parameter this way.

Since this regression was never released, there are no release notes.

Backport from #181239

Fixes #167120
DeltaFile
+11-4clang/lib/Sema/SemaCXXScopeSpec.cpp
+5-0clang/test/SemaCXX/GH167120.cpp
+16-42 files

LLVM/project 698202dclang/lib/Sema SemaOverload.cpp, clang/test/SemaTemplate temp_arg_nontype_cxx11.cpp

[clang] Backport: stop error recovery in SFINAE for narrowing in converted constant expressions

A narrowing conversion in a converted constant expression should produce an
invalid expression so that [temp.deduct.general]p7 is satisfied, by stopping
substitution at this point.

Fixes #167709
DeltaFile
+10-1clang/test/SemaTemplate/temp_arg_nontype_cxx11.cpp
+8-0clang/lib/Sema/SemaOverload.cpp
+18-12 files

LLVM/project b1b0bb9clang/lib/Sema SemaTemplateDeduction.cpp, clang/test/SemaTemplate temp_arg_template_p0522.cpp

[clang] create local instantiation scope for matching template template parameters

This fixes a bug where a partial substitution from the enclosing scope
is used to prepopulate an unrelated template argument deduction.

Backport from #183219

Fixes #181166
DeltaFile
+7-0clang/test/SemaTemplate/temp_arg_template_p0522.cpp
+2-0clang/lib/Sema/SemaTemplateDeduction.cpp
+9-02 files

LLVM/project a9a4c1eclang/docs ReleaseNotes.rst

fixup! [analyzer] Fix crash in MallocChecker when a function has both ownership_returns and ownership_takes (#183583)

Mention in the release docs
DeltaFile
+3-0clang/docs/ReleaseNotes.rst
+3-01 files

LLVM/project c82ee13clang/lib/StaticAnalyzer/Checkers MallocChecker.cpp, clang/test/Analysis malloc-annotations.c

[analyzer] Fix crash in MallocChecker when a function has both ownership_returns and ownership_takes (#183583)

When a function was annotated with both `ownership_returns` and
`ownership_takes` (or `ownership_holds`), MallocChecker::evalCall would
fall into the freeing-only branch (isFreeingOwnershipAttrCall) and call
checkOwnershipAttr without first calling MallocBindRetVal. That meant no
heap symbol had been conjured for the return value, so
checkOwnershipAttr later dereferenced a null/invalid symbol and crashed.

Fix: merge the two dispatch branches so that MallocBindRetVal is always
called first whenever ownership_returns is present, regardless of
whether the function also carries ownership_takes/ownership_holds.

The crash was introduced in #106081
339282d49f5310a2837da45c0ccc19da15675554.
Released in clang-20, and crashing ever since.

Fixes #183344.


    [2 lines not shown]
DeltaFile
+93-0clang/test/Analysis/malloc-annotations.c
+3-7clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+96-72 files

LLVM/project 1e66cb3clang/docs ReleaseNotes.rst, clang/lib/Sema SemaExpr.cpp

[Clang] Don't diagnose missing members when looking at the instantiating class template

This backports https://github.com/llvm/llvm-project/pull/180725 to Clang
22.

The perfect matching patch revealed another bug where recursive
instantiations could lead to the escape of SFINAE errors, as shown in
the issue.
DeltaFile
+81-0clang/test/SemaCXX/overload-resolution-deferred-templates.cpp
+1-1clang/lib/Sema/SemaExpr.cpp
+1-0clang/docs/ReleaseNotes.rst
+83-13 files

LLVM/project 55f9cf3llvm/lib/Target/RISCV/MCTargetDesc RISCVMCAsmInfo.cpp

RISCVMCAsmInfo: Remove redundant `UseAtForSpecifier = false`. NFC (#183890)

UseAtForSpecifier defaults to false in MCAsmInfo, and RISCVMCAsmInfo
never calls initializeAtSpecifiers (which sets it to true).
DeltaFile
+0-1llvm/lib/Target/RISCV/MCTargetDesc/RISCVMCAsmInfo.cpp
+0-11 files

LLVM/project cd6e5a6llvm/lib/Target/Hexagon HexagonISelLoweringHVX.cpp, llvm/test/CodeGen/Hexagon extract-hvx-subvector-pred-small.ll

[Hexagon] Fix extractHvxSubvectorPred shuffle mask for small predicates (#181364)

The loop generating the shuffle mask in extractHvxSubvectorPred used
HwLen/ResLen as the iteration count, but each iteration produces 8
elements (ResLen * Rep where Rep = 8/ResLen). This means the total mask
size was (HwLen/ResLen) * 8, which only equals HwLen when ResLen == 8.
For smaller predicate subvectors (e.g., <4 x i1> or <2 x i1>), the mask
was too large, causing an assertion failure in getVectorShuffle.

Fix by using HwLen/8 as the loop bound, which correctly produces HwLen
elements regardless of ResLen.

(cherry picked from commit c3a86ff2d0b397d757345fad7e29c2a6e7dbc823)
DeltaFile
+28-0llvm/test/CodeGen/Hexagon/extract-hvx-subvector-pred-small.ll
+1-1llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp
+29-12 files

LLVM/project c9160c2mlir/include/mlir/IR BuiltinTypeInterfaces.td BuiltinAttributes.td, mlir/lib/AsmParser AttributeParser.cpp

[mlir][IR] Generalize `DenseElementsAttr` to custom element types (#179122)

`DenseElementsAttr` supports only a hard-coded list of element types:
`int`, `index`, `float`, `complex`. This commit generalizes the
`DenseElementsAttr` infrastructure: it now supports arbitrary element
types, as long as they implement the new `DenseElementTypeInterface`.

The `DenseElementTypeInterface` has the following helper functions:
- `getDenseElementBitSize`: Query the size of an element in bits. (When
storing an element in memory, each element is padded to a full byte.
This is an existing limitation of the `DenseElementsAttr`; with an
exception for `i1`.)
- `convertToAttribute`: Attribute factory / deserializer. Converts bytes
into an MLIR attribute. The attribute provides the assembly format /
printer for a single element.
- `convertFromAttribute`: Serializer. Converts an MLIR attribute into
bytes.

Note: `convertToAttribute` / `convertFromAttribute` are mainly for

    [23 lines not shown]
DeltaFile
+124-1mlir/lib/AsmParser/AttributeParser.cpp
+25-92mlir/lib/IR/BuiltinAttributes.cpp
+87-0mlir/lib/IR/BuiltinTypes.cpp
+83-0mlir/test/IR/dense-elements-type-interface.mlir
+74-1mlir/include/mlir/IR/BuiltinTypeInterfaces.td
+32-13mlir/include/mlir/IR/BuiltinAttributes.td
+425-1078 files not shown
+579-11914 files

LLVM/project 1ff1e5fllvm/lib/Transforms/InstCombine InstCombineSimplifyDemanded.cpp, llvm/test/Transforms/InstCombine simplify-demanded-fpclass.ll

InstCombine: Stop applying nofpclass from use nofpclass attribute (#183835)

Functionally reverts a80d4329ce96856a02bd279c800c3d08619da4c9, with new
test.
This should be applied somewhere, but this is the wrong place.

Fixes regression reported after #182444
DeltaFile
+21-2llvm/test/Transforms/InstCombine/simplify-demanded-fpclass.ll
+0-5llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
+21-72 files

LLVM/project 32eb450llvm/test/CodeGen/AMDGPU coexec-sched-effective-stall.mir

Update coexec-sched-effective-stall.mir
DeltaFile
+0-2llvm/test/CodeGen/AMDGPU/coexec-sched-effective-stall.mir
+0-21 files