LLVM/project 7fb4f73polly/include/polly ScopInfo.h, polly/lib/Analysis ScopBuilder.cpp

[Polly] Avoid __builtin_assume circular context reasoning (#189350)

The conversion of SCEVs to isl::pw_aff may only be valid under
conditions that have to be confirmed via RTC. This also happens with
__builtin_assume. These user-added assumptions are then added to
ScopInfo::Context. However, the conclusion in ScopInfo::Context is then
also used to simplify ("gist") its own RTC preconditions in
ScopInfo::AssumedContext and ScopInfo::InvalidContext away.

Avoid by adding user assumptions with preconditions to
ScopInfo::DefinedBehaviourContext instead, which is not used to simplify
AssumedContext/InvalidContext.

Fixes #187922

Thanks @thapgua for the report
DeltaFile
+155-0polly/test/ScopInfo/issue187922.ll
+14-3polly/lib/Analysis/ScopBuilder.cpp
+6-4polly/test/ScopInfo/user_provided_assumptions.ll
+3-1polly/include/polly/ScopInfo.h
+178-84 files

LLVM/project bfac1d8llvm/include/llvm/CodeGen TargetLowering.h, llvm/lib/CodeGen TargetLoweringBase.cpp

[spr] initial version

Created using spr 1.3.8-wip
DeltaFile
+5-15llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+8-0llvm/include/llvm/CodeGen/TargetLowering.h
+7-0llvm/lib/CodeGen/TargetLoweringBase.cpp
+20-153 files

LLVM/project e901b02llvm/lib/Transforms/Utils BasicBlockUtils.cpp, llvm/unittests/Transforms/Utils BasicBlockUtilsTest.cpp

[BasicBlockUtils] Fixed LoopInfo update in UpdateAnalysisInformation() (#177147)

SplitLandingPadPredecessors() results in an irreducible loop
and makes LoopInfo invalid. Verification results in a crash:
Assertion `CB != OutsideLoopPreds[i] && "Loop has multiple entry
points!"' failed.

Created a new test with a broken LoopInfo after
SplitLandingPadPredecessors().
The test @split-lp-predecessors-test() after
SplitBlockPredecessors(catch_dest, { loop }, "", DT, LI) changes to
the following IR where the loop {%catch_dest} gets into irreducible
loop {%catch_dest.split-lp, %catch_dest}:

```
define void @split-lp-predecessors-test() personality ptr null {
entry:
  invoke void @foo()
          to label %loop unwind label %catch_dest.split-lp

    [32 lines not shown]
DeltaFile
+92-0llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp
+18-2llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
+110-22 files

LLVM/project c7908d3llvm/lib/Transforms/Vectorize SLPVectorizer.cpp

[SLP][NFC]Use passing-by-ref in the range based loop to prevent warnings/errors
DeltaFile
+1-1llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+1-11 files

LLVM/project 4d3759dllvm/lib/Transforms/InstCombine InstCombineMulDivRem.cpp, llvm/test/Transforms/InstCombine fmul.ll

[InstCombine] Fold X * ldexp(1.0, Y) -> ldexp(X, Y). (#188493)

This would avoid the FMUL in sequences such as
[these](https://godbolt.org/z/xhqfe5sb1).
DeltaFile
+109-0llvm/test/Transforms/InstCombine/fmul.ll
+9-0llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+118-02 files

LLVM/project e6c89e8llvm/lib/TableGen Record.cpp, llvm/test/TableGen intrinsic-arginfo-error.td

[TableGen] Improve the error report of getElementAsRecord (#189302)
DeltaFile
+10-0llvm/test/TableGen/intrinsic-arginfo-error.td
+2-1llvm/lib/TableGen/Record.cpp
+12-12 files

LLVM/project 65cb5c3clang/include/clang/Basic BuiltinsX86.td, clang/lib/Headers emmintrin.h

[clang][x86] Fix the return type of the cvtpd2dq builtin (#189254)

The CVTPD2DQ instruction converts packed 64-bit floating-point values to
packed 32-bit signed integer values. This patch fixes the return type of
the corresponding builtin, which previously returned a vector of two
64-bit signed integers. The new behavior is in line with the return type
of the CVTTPD2DQ builtin.
DeltaFile
+1-1clang/include/clang/Basic/BuiltinsX86.td
+1-1clang/lib/Headers/emmintrin.h
+1-1clang/test/CodeGen/builtins-x86.c
+3-33 files

LLVM/project 2b41985llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp SelectionDAG.cpp

[DAG] Fix incorrect ForSigned handling in computeConstantRange calls (#188889)

Fix two places where ForSigned was incorrectly passed to
computeConstantRange, causing wrong signed/unsigned range computation.

In computeConstantRangeIncludingKnownBits (DemandedElts overload),
the call omitted ForSigned, so Depth (unsigned) was implicitly
converted to bool for the ForSigned parameter. Introduced in
a6a66a4e6915.

In visitIMINMAX, the call always passed ForSigned=false, even when
folding SMAX/SMIN which query signed bounds from the resulting range.
DeltaFile
+2-1llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+1-1llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+3-22 files

LLVM/project 6c8782bmlir/lib/Dialect/Vector/Transforms VectorDistribute.cpp

[MLIR][Vector] Fix direct operand.set() bypassing rewriter in WarpOpScfIfOp/ForOp (#188948)

In WarpOpScfIfOp and WarpOpScfForOp, the walk that updates users of
escaping values (after moving them to the inner WarpOp) was calling
operand.set() directly, bypassing the rewriter API. This causes the
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS fingerprint check to fail.

Fix by wrapping the operand updates with rewriter.modifyOpInPlace().

Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
DeltaFile
+20-2mlir/lib/Dialect/Vector/Transforms/VectorDistribute.cpp
+20-21 files

LLVM/project 0bb0c7dmlir/lib/Dialect/MPI/IR MPIOps.cpp

[MLIR][MPI] Fix direct getRefMutable().assign() bypassing rewriter in FoldCast (#188943)

The FoldCast canonicalization pattern was calling
op.getRefMutable().assign(src) directly, bypassing the rewriter. This
violates the pattern API contract and causes fingerprint change failures
when
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS is enabled. Wrap the
modification with b.modifyOpInPlace() to properly notify the rewriter of
the changes.

Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.
DeltaFile
+1-1mlir/lib/Dialect/MPI/IR/MPIOps.cpp
+1-11 files

LLVM/project ccb64cbmlir/include/mlir/IR Value.h BlockSupport.h, mlir/lib/IR Value.cpp

[Value] Mark getOperandNumber as Const (#189267)
DeltaFile
+2-2mlir/lib/IR/Value.cpp
+1-1mlir/include/mlir/IR/Value.h
+1-1mlir/include/mlir/IR/BlockSupport.h
+4-43 files

LLVM/project 9e7e955llvm/lib/Target/AArch64/MCTargetDesc AArch64InstPrinter.cpp

fixup! Improve printing code for tabs and commas
DeltaFile
+5-8llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+5-81 files

LLVM/project d3f1e0dllvm/lib/Target/SPIRV SPIRVEmitIntrinsics.cpp SPIRVPostLegalizer.cpp, llvm/test/CodeGen/SPIRV/instructions phi-aggregate-loop.ll

[SPIR-V] Fix aggregate PHI type mismatch in loops (#186086)
DeltaFile
+112-0llvm/test/CodeGen/SPIRV/instructions/phi-aggregate-loop.ll
+37-1llvm/lib/Target/SPIRV/SPIRVEmitIntrinsics.cpp
+9-6llvm/lib/Target/SPIRV/SPIRVPostLegalizer.cpp
+3-1llvm/lib/Target/SPIRV/SPIRVUtils.cpp
+161-84 files

LLVM/project 53335d4llvm/test/MC/AArch64 armv9.4a-gcs.s arm64-aliases.s

fixup! Move new tests into arm64-aliases.s
DeltaFile
+0-40llvm/test/MC/AArch64/armv9.4a-gcs.s
+32-0llvm/test/MC/AArch64/arm64-aliases.s
+25-0llvm/test/MC/AArch64/armv9a-sysp-pairs.s
+2-6llvm/test/MC/AArch64/brbe.s
+0-5llvm/test/MC/AArch64/armv8.9a-debug-pmu.s
+0-5llvm/test/MC/AArch64/armv9.6a-rme-gpc3.s
+59-566 files

LLVM/project 9eb3c49llvm/lib/Target/AArch64 AArch64InstrInfo.td, llvm/lib/Target/AArch64/AsmParser AArch64AsmParser.cpp

fixup! Parse instructions in AArch64AsmParser.cpp
DeltaFile
+87-5llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
+0-14llvm/lib/Target/AArch64/AArch64InstrInfo.td
+87-192 files

LLVM/project dd242a1llvm/lib/Target/AArch64 AArch64InstrInfo.td AArch64InstrFormats.td, llvm/lib/Target/AArch64/MCTargetDesc AArch64InstPrinter.cpp

[AArch64][llvm] Redefine some isns as an alias of `SYS`

Some instructions are not currently defined as an alias of `SYS`
when they should be, so they don't disassemble back into the
native instruction, but instead disassemble into `SYS`.
Fix these cases and add additional testcase.

Note that I've left `GCSPUSHM` due to a `mayStore`, `GCSSS1` and
`GCSSS2` as they're used in AArch64ISelDAGToDAG.cpp, and `GCSPOPM`
has an intrinsic pattern in AArch64InstrInfo.td. They will disassemble
correctly though, as they use `InstAlias`.
DeltaFile
+116-0llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp
+24-23llvm/lib/Target/AArch64/AArch64InstrInfo.td
+40-0llvm/test/MC/AArch64/armv9.4a-gcs.s
+0-19llvm/lib/Target/AArch64/AArch64InstrFormats.td
+6-2llvm/test/MC/AArch64/brbe.s
+5-0llvm/test/MC/AArch64/armv8.9a-debug-pmu.s
+191-441 files not shown
+196-447 files

LLVM/project f2a9b07llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Consolidate the logic for checking overlap at the boundary (NFCI) (#189341)

In the Weak Crossing SIV test, there were two places where we checked
the dependency at the boundary, one is at the first iteration, and the
other is at the last iteration. Now the former can be merged into the
latter. There used to be an edge case when the coefficient is zero, and
we had an explicit check for that. This patch removes that check as
well, by moving the boundary check after the assertion that ensures the
(maybe negated) coefficient is positive.
DeltaFile
+1-12llvm/lib/Analysis/DependenceAnalysis.cpp
+1-121 files

LLVM/project 3bc8c57clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/CodeGen CIRGenModule.cpp

[CIR] Add calling_conv attribute to FuncOp with lowering support
DeltaFile
+38-0clang/test/CIR/IR/calling-conv.cir
+34-0clang/test/CIR/Lowering/calling-conv.cir
+23-5clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+24-1clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+16-1clang/include/clang/CIR/Dialect/IR/CIROps.td
+5-6clang/lib/CIR/CodeGen/CIRGenModule.cpp
+140-133 files not shown
+143-219 files

LLVM/project fd7388dclang/lib/Sema SemaDecl.cpp, clang/test/Sema redefine_extname.cpp

`#pragma redefine_extname`: warn only if conflicting ID is at TU scope. (#188256)

As an example, this should keep warning:

```
static void foo();
```

because here, the identiifer `foo` won't be affected. In fact, it now
becomes (mostly) impossible to even declare anything later that would
get affected, thus the new definition is in active conflict with the
`#pragma`.

This however will not warn anymore:

```
namespace blargh {
static void foo();
}

    [30 lines not shown]
DeltaFile
+108-0clang/test/Sema/redefine_extname.cpp
+6-2clang/lib/Sema/SemaDecl.cpp
+114-22 files

LLVM/project 475f71eclang/include/clang/Sema MultiplexExternalSemaSource.h ExternalSemaSource.h, clang/include/clang/Serialization ASTReader.h

Serialize `#pragma redefine_extname` into precompiled headers. (#186755)

Also deserialize them back again on reading.

The implementation is based on the existing implementation of `#pragma
weak` serialization.

Fixes issue #186742.

---------

Co-authored-by: Chuanqi Xu <yedeng.yd at linux.alibaba.com>
DeltaFile
+43-0clang/lib/Serialization/ASTReader.cpp
+23-0clang/lib/Serialization/ASTWriter.cpp
+14-0clang/test/PCH/pragma-redefine-extname.c
+11-1clang/include/clang/Serialization/ASTReader.h
+11-0clang/include/clang/Sema/MultiplexExternalSemaSource.h
+10-0clang/include/clang/Sema/ExternalSemaSource.h
+112-17 files not shown
+150-113 files

LLVM/project 5d29276clang/include/clang/Basic OffloadArch.h, clang/lib/Basic OffloadArch.cpp

clang: Return Triple from OffloadArchToTriple instead of a string

Also stop bothering to call normalizeOffloadTriple. This was
produced by code which should always produce normalized triples.
DeltaFile
+8-7clang/lib/Basic/OffloadArch.cpp
+1-5clang/lib/Driver/Driver.cpp
+2-2clang/include/clang/Basic/OffloadArch.h
+11-143 files

LLVM/project be94bfdllvm/lib/Analysis DependenceAnalysis.cpp, llvm/test/Analysis/DependenceAnalysis weak-zero-siv-delta-signed-min.ll

[DA] Stop negating Delta in the Weak Zero SIV test (#188212)

This patch removes the variable `NewDelta`, which was calculated as the
negation of `Delta`, along with its uses. `NewDelta` is now referenced
in only one place, and that code is effectively dead because more
general analysis with ConstantRange is performed at an earlier stage.
Also the test using `NewDelta` is not correct when `Delta` is a signed
minimum value, as negating it yields the same value as original. This
patch also fixes the correctness issue in such a situation.
DeltaFile
+0-12llvm/lib/Analysis/DependenceAnalysis.cpp
+6-6llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-delta-signed-min.ll
+6-182 files

LLVM/project 0069867mlir/include/mlir/Dialect/Affine/Transforms Passes.td Transforms.h, mlir/lib/Dialect/Affine/Transforms SimplifyAffineWithBounds.cpp CMakeLists.txt

[mlir][affine] Add ValueBounds-based simplification for delinearize(linearize) pairs (#187245)

`affine.linearize_index` pairs
(`CancelDelinearizeOfLinearizeDisjointExactTail`) only match when basis
elements are exactly equal as `OpFoldResult` values. This means they
cannot simplify cases where dynamic basis products are semantically
equal but represented by different SSA values or affine expressions.

This patch adds a new pass `affine-simplify-with-bounds` with two
rewrite patterns that use `ValueBoundsConstraintSet` to prove equality
of basis products:

- **`SimplifyDelinearizeOfLinearizeDisjointManyToOneTail`**: matches
when multiple consecutive linearize dimensions have a product equal to a
single delinearize dimension (many-to-one).
- **`SimplifyDelinearizeOfLinearizeDisjointOneToManyTail`**: matches
when a single linearize dimension equals the product of multiple
consecutive delinearize dimensions (one-to-many).


    [8 lines not shown]
DeltaFile
+255-0mlir/lib/Dialect/Affine/Transforms/SimplifyAffineWithBounds.cpp
+167-0mlir/test/Dialect/Affine/simplify-with-bounds.mlir
+12-0mlir/include/mlir/Dialect/Affine/Transforms/Passes.td
+4-0mlir/include/mlir/Dialect/Affine/Transforms/Transforms.h
+1-0mlir/lib/Dialect/Affine/Transforms/CMakeLists.txt
+439-05 files

LLVM/project 89679edclang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/CodeGen CIRGenModule.cpp

[CIR] Add calling_conv attribute to FuncOp with lowering support
DeltaFile
+38-0clang/test/CIR/IR/calling-conv.cir
+34-0clang/test/CIR/Lowering/calling-conv.cir
+23-5clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+24-1clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+14-1clang/include/clang/CIR/Dialect/IR/CIROps.td
+6-6clang/lib/CIR/CodeGen/CIRGenModule.cpp
+139-133 files not shown
+142-219 files

LLVM/project a7bc628mlir/lib/Dialect/Tosa/IR TosaCanonicalizations.cpp, mlir/lib/Dialect/Tosa/Transforms TosaFolders.cpp

[mlir][tosa] Harden folds/canonicalizations for unranked and dynamic shapes (#188188)

This MR fixes #188187 and #187974. Tighten TOSA constant folding and
identity-style folds so they do not produce invalid or type-incorrect
results when the op’s result type is unranked, rank-dynamic, or
otherwise not a static `RankedTensorType`. Several paths previously
assumed ranked/static shapes or folded through to the operand without
checking that the result type matched the value being returned.

`DenseElementsAttr::get`, `SplatElementsAttr::get` and similar builders
need a static shape; folding with `tensor<*xT>` or dynamic dims must not
fabricate dense attributes with the wrong shape.

Returning the operand from a “no-op” fold is only valid when
`operand.getType() == op.getType()`; otherwise the folder would change
the IR’s type semantics (e.g. ranked → unranked). Which in the bigger
pipeline supposed to be handled by `-tosa-infer-shapes`

Assisted-by: CLion code completion, GPT 5.3 - Codex

    [3 lines not shown]
DeltaFile
+97-1mlir/test/Dialect/Tosa/canonicalize.mlir
+36-29mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
+40-1mlir/test/Dialect/Tosa/constant_folding.mlir
+19-0mlir/test/Dialect/Tosa/tosa-layerwise-constant-fold.mlir
+6-0mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp
+198-315 files

LLVM/project f51176allvm/lib/Analysis DependenceAnalysis.cpp, llvm/test/Analysis/DependenceAnalysis weak-crossing-siv-overflow.ll

Merge branch 'main' into users/kasuga-fj/da-weak-zero-siv-delete-neg-delta
DeltaFile
+56-3llvm/test/Analysis/DependenceAnalysis/weak-crossing-siv-overflow.ll
+14-21llvm/lib/Analysis/DependenceAnalysis.cpp
+70-242 files

LLVM/project c3e7f98llvm/lib/Analysis DependenceAnalysis.cpp, llvm/test/Analysis/DependenceAnalysis weak-crossing-siv-overflow.ll

[DA] Fix overflow of calculation in weakCrossingSIVtest (#188450)

This patch fixes a correctness issue where integer overflow in the
upper bound calculation of weakCrossingSIVtest caused the pass to
incorrectly prove independence.

The previous logic used `SCEV::getMulExpr` to calculate
`2 * ConstCoeff * UpperBound` and compared it to `Delta` using
`isKnownPredicate`. In the presence of overflow, this could yield
unsafe results.

This change replaces the SCEV arithmetic with `ConstantRange` to   
work around calculation overflows, ensures we conservatively assume   
a dependence if the bounds cannot be proven safe.

---------

Signed-off-by: Ruoyu Qiu <cabbaken at outlook.com>
DeltaFile
+56-3llvm/test/Analysis/DependenceAnalysis/weak-crossing-siv-overflow.ll
+14-21llvm/lib/Analysis/DependenceAnalysis.cpp
+70-242 files

LLVM/project 776ba94clang/unittests/Format AlignmentTest.cpp FormatTest.cpp, llvm/test/CodeGen/AMDGPU fract-match.ll

Merge branch 'main' into users/kasuga-fj/da-weak-zero-siv-delete-neg-delta
DeltaFile
+3,566-0clang/unittests/Format/AlignmentTest.cpp
+19-3,544clang/unittests/Format/FormatTest.cpp
+2,210-1,106llvm/test/MC/AMDGPU/gfx10_unsupported.s
+2,522-1llvm/test/CodeGen/AMDGPU/fract-match.ll
+863-863llvm/test/MC/AMDGPU/gfx7_unsupported.s
+1,185-397llvm/test/MC/AMDGPU/gfx950_asm_features.s
+10,365-5,911964 files not shown
+34,520-19,075970 files

LLVM/project 85446d4lldb/source/Commands CommandObjectThread.cpp CommandObjectPlugin.cpp, lldb/source/Interpreter CommandInterpreter.cpp

[lldb] Use AppendMessageWithFormatv instead of AppendMessageWithFormat (#185634)

Part 4. This converts all the remaining simple uses (the ones that ended
with a newline).

What remains in tree are the outliers that expect multiple ending
newlines, or are building a message in pieces.
DeltaFile
+13-13lldb/source/Interpreter/CommandInterpreter.cpp
+8-9lldb/source/Commands/CommandObjectThread.cpp
+6-6lldb/source/Commands/CommandObjectPlugin.cpp
+4-4lldb/source/Commands/CommandObjectProcess.cpp
+31-324 files

LLVM/project 8a4f210llvm/lib/Transforms/Vectorize VPlanTransforms.cpp VPlanUtils.cpp

[VPlan] Generalize noalias-licm-check to replicate regions (NFC) (#187017)

In order to use the cannotHoistOrSinkWithNoAlias check in use-sites
after replicate regions are created, generalize it to work with
replicate regions.
DeltaFile
+12-18llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+21-0llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+6-0llvm/lib/Transforms/Vectorize/VPlanUtils.h
+39-183 files