LLVM/project 9c2a3camlir/lib/Dialect/OpenACC/IR OpenACC.cpp, mlir/test/Dialect/OpenACC ops.mlir

[MLIR] Fix OpenACC parser crash with opaque pointers (#183521)

Fixes #181453
Fixes #181589
DeltaFile
+18-0mlir/test/Dialect/OpenACC/ops.mlir
+11-4mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+29-42 files

LLVM/project a8a6613llvm/lib/Target/AMDGPU GCNSchedStrategy.cpp

[AMDGPU][Scheduler] Fix compilation fail in EXPENSIVE_CHECKS (#183745)

Bug introduced by #182853 (`Remat` is now a pointer).
DeltaFile
+1-1llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+1-11 files

LLVM/project 7402312llvm/lib/Target/SPIRV SPIRVInstructionSelector.cpp

[NFC][SPIRV] Fix compile warnings (#183725)

Fix compile warnings in SPIR-V 

```
llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:2882:26: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
 2882 |         return IsFloatTy ? SPIRV::OpGroupNonUniformFMax : IntOp;
      |                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp: In lambda function:
llvm-project/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp:2897:26: warning: enumerated and non-enumerated type in conditional expression [-Wextra]
 2897 |         return IsFloatTy ? SPIRV::OpGroupNonUniformFMin : IntOp;
      |                ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
DeltaFile
+4-4llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+4-41 files

LLVM/project 9210d70llvm/lib/CodeGen/MIRParser MIParser.cpp, llvm/test/CodeGen/MIR/Generic expected-unsigned.mir

[MIR] Error on signed integer in getUnsigned (#183171)

Previously we effectively took the absolute value of the APSInt, instead
diagnose the unexpected negative value.

Change-Id: I4efe961e7b29fdf1d5f97df12f8139aac12c9219
DeltaFile
+26-0llvm/test/CodeGen/MIR/Generic/expected-unsigned.mir
+4-1llvm/lib/CodeGen/MIRParser/MIParser.cpp
+30-12 files

LLVM/project bf3ab0dllvm/lib/Target/AMDGPU GCNSchedStrategy.cpp GCNRegPressure.cpp

[AMDGPU][Scheduler] Add `GCNRegPressure`-based methods to `GCNRPTarget` (#182853)

This adds a few methods to `GCNRPTarget` that can estimate/perform RP
savings based on `GCNRegPressure` instead of a single `Register`,
opening the door to model/incorporate more complex savings made up of
multiple registers of potentially different classes. The scheduler's
rematerialization stage now uses this new API.

Although there are no test changes this is not really NFC since register
pressure savings in the rematerialization stage are now computed through
`GCNRegPressure` instead of the stage itself. If anything this makes
them more consistent with the rest of the RP-tracking infrastructure.
DeltaFile
+51-53llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+27-3llvm/lib/Target/AMDGPU/GCNRegPressure.cpp
+12-14llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+13-1llvm/lib/Target/AMDGPU/GCNRegPressure.h
+103-714 files

LLVM/project 72a1d86llvm/lib/Target/AMDGPU AMDGPUFeatures.td AMDGPU.td, llvm/lib/Target/AMDGPU/Utils AMDGPUBaseInfo.cpp

[AMDGPU] Use subtarget feature for flat offset bit width instead of arch checks
DeltaFile
+10-0llvm/lib/Target/AMDGPU/AMDGPUFeatures.td
+3-2llvm/lib/Target/AMDGPU/AMDGPU.td
+2-3llvm/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp
+3-0llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
+18-54 files

LLVM/project 20df251llvm/runtimes CMakeLists.txt

[LLVM][Runtimes] Add 'llvm-gpu-loader' to dependency list (#183601)

Summary:
This is used to run the unit tests in libc / libc++. It must exist in
the build directory's binary path, but without this dependnecy we may
not build it before running the runtimes build. This should ensure that
it's present, and only if we have tests enabled.
DeltaFile
+1-0llvm/runtimes/CMakeLists.txt
+1-01 files

LLVM/project 5df4ea3llvm/lib/Analysis ScalarEvolution.cpp, llvm/lib/Transforms/Scalar LoopStrengthReduce.cpp LoopFuse.cpp

!fixup more cleanups
DeltaFile
+22-33llvm/lib/Analysis/ScalarEvolution.cpp
+2-6llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+1-2llvm/lib/Transforms/Scalar/LoopFuse.cpp
+25-413 files

LLVM/project dc2ec04llvm/utils/gn/secondary/lldb/include/lldb/Host BUILD.gn

[gn] port 3490d28c8cab
DeltaFile
+0-1llvm/utils/gn/secondary/lldb/include/lldb/Host/BUILD.gn
+0-11 files

LLVM/project 8028a8ebolt/docs BinaryAnalysis.md

Apply more suggestions
DeltaFile
+5-5bolt/docs/BinaryAnalysis.md
+5-51 files

LLVM/project 8a0be0bllvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 gfni-xor-fold.ll gfni-xor-fold-avx512.ll

[X86] Fold XOR of two vgf2p8affineqb instructions with same input (#179900)

This patch implements an optimization to fold XOR of two
`vgf2p8affineqb` instructions operating on the same input.
This optimization:
Reduces instruction count from 3 to 2
Eliminates one vgf2p8affineqb instruction 
Added combineXorWithTwoGF2P8AFFINEQB function in X86ISelLowering.cpp
Uses sd_match pattern matching for consistency with existing code
Checks that both operations have single use to avoid code bloat
Verifies both operations use the same input
Handles commutative XOR patterns automatically
DeltaFile
+127-0llvm/test/CodeGen/X86/gfni-xor-fold.ll
+74-0llvm/test/CodeGen/X86/gfni-xor-fold-avx512.ll
+34-0llvm/lib/Target/X86/X86ISelLowering.cpp
+235-03 files

LLVM/project c05f99abolt/docs BinaryAnalysis.md

Apply suggestions from code review

Co-authored-by: Kristof Beyls <kristof.beyls at arm.com>
DeltaFile
+8-8bolt/docs/BinaryAnalysis.md
+8-81 files

LLVM/project 85f3133llvm/include/llvm/Analysis DependenceAnalysis.h, llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Rewrite formula in the Weak Zero SIV tests
DeltaFile
+67-72llvm/lib/Analysis/DependenceAnalysis.cpp
+4-8llvm/include/llvm/Analysis/DependenceAnalysis.h
+2-6llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-overflow.ll
+4-4llvm/test/Analysis/DependenceAnalysis/weak-zero-siv-large-btc.ll
+2-2llvm/test/Analysis/DependenceAnalysis/weak-crossing-siv-large-btc.ll
+79-925 files

LLVM/project 2f46246clang/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.

Assisted-By: claude
DeltaFile
+93-0clang/test/Analysis/malloc-annotations.c
+3-7clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+96-72 files

LLVM/project e3dda81flang/include/flang/Parser openmp-utils.h

[flang][OpenMP] Add `is_range<R>` trait to detect classes with begin/end, NFC (#183615)

DeltaFile
+16-9flang/include/flang/Parser/openmp-utils.h
+16-91 files

LLVM/project c44f957llvm/include/llvm/Analysis DependenceAnalysis.h, llvm/lib/Analysis DependenceAnalysis.cpp

[DA] Remove isPeelFirst and isPeelLast
DeltaFile
+1-24llvm/include/llvm/Analysis/DependenceAnalysis.h
+0-20llvm/lib/Analysis/DependenceAnalysis.cpp
+3-3llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll
+3-3llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll
+7-504 files

LLVM/project 744ee2dllvm/lib/Analysis DependenceAnalysis.cpp, llvm/test/Analysis/DependenceAnalysis weak_zero_siv_parametric_coeff.ll WeakZeroDstSIV.ll

[DA] Fix the WeakZeroSIV tests when the coeff may be non-zero
DeltaFile
+4-10llvm/test/Analysis/DependenceAnalysis/weak_zero_siv_parametric_coeff.ll
+4-2llvm/lib/Analysis/DependenceAnalysis.cpp
+1-1llvm/test/Analysis/DependenceAnalysis/WeakZeroDstSIV.ll
+1-1llvm/test/Analysis/DependenceAnalysis/WeakZeroSrcSIV.ll
+10-144 files

LLVM/project 15f7bdfllvm/test/Analysis/DependenceAnalysis weak_zero_siv_parametric_coeff.ll weak_zero_siv_parametric_const.ll

[DA] Add tests for the WeakZeroSIV tests return incorrect result (NFC)
DeltaFile
+106-0llvm/test/Analysis/DependenceAnalysis/weak_zero_siv_parametric_coeff.ll
+101-0llvm/test/Analysis/DependenceAnalysis/weak_zero_siv_parametric_const.ll
+207-02 files

LLVM/project fc69531llvm/lib/ExecutionEngine ExecutionEngine.cpp, llvm/test/ExecutionEngine/Interpreter test-interp-vec-insertelement.ll

[LLVM][ExecutionEngine] Add vector ConstantInt/FP support to getConstantValue(). (#182538)

Unify vector constant handling via calls to getAggregateElement rather
than handling each constant type separately.
DeltaFile
+24-86llvm/lib/ExecutionEngine/ExecutionEngine.cpp
+3-0llvm/test/ExecutionEngine/Interpreter/test-interp-vec-insertelement.ll
+27-862 files

LLVM/project d867128llvm/test/Transforms/LoopVectorize iv-select-cmp.ll select-index-interleaving.ll, llvm/test/Transforms/LoopVectorize/AArch64 select-index.ll

[VPlan] Add nuw to unrolled canonical IVs (#183716)

After #183080, the canonical IV (not the increment!) can't overflow. So
now canonical IVs that are unrolled will have steps that don't overflow,
so we can add the nuw flag.

This allows us to tighten the VPlanVerifier isKnownMonotonic check by
restricting it to adds with nuw.
DeltaFile
+24-24llvm/test/Transforms/LoopVectorize/iv-select-cmp.ll
+17-17llvm/test/Transforms/LoopVectorize/PowerPC/exit-branch-cost.ll
+8-8llvm/test/Transforms/LoopVectorize/AArch64/select-index.ll
+8-8llvm/test/Transforms/LoopVectorize/select-index-interleaving.ll
+8-8llvm/test/Transforms/LoopVectorize/X86/replicating-load-store-costs.ll
+6-9llvm/test/Transforms/LoopVectorize/reduction-inloop-uf4.ll
+71-7434 files not shown
+150-15140 files

LLVM/project 3676ae4llvm/lib/Target/SPIRV SPIRVPostLegalizer.cpp

[NFC][SPIRV] Remove dead code from `SPIRVPostLegalizer.cpp` (#183585)

Both `visit` functions are unused in the file and outside of it.
DeltaFile
+0-30llvm/lib/Target/SPIRV/SPIRVPostLegalizer.cpp
+0-301 files

LLVM/project 6b91049clang/docs ReleaseNotes.rst, clang/lib/AST ExprConstant.cpp

[Clang] support C23 constexpr struct member access in constant expressions (#182770)

Fixes #178349

--- 

This patch resolves an issue where accessing C23 `constexpr` struct
members using the dot operator was not recognized as a constant
expression.

According to C23 spec:

> 6.6p7:
> 
> An identifier that is:
> — an enumeration constant,
> — a predefined constant, or
> — declared with storage-class specifier constexpr and has an object
type,

    [20 lines not shown]
DeltaFile
+54-0clang/test/Sema/constexpr-member-access.c
+34-0clang/test/CodeGen/c23-constexpr-member-access.c
+18-1clang/lib/AST/ExprConstant.cpp
+1-0clang/docs/ReleaseNotes.rst
+107-14 files

LLVM/project 4d169f3llvm/docs LangRef.rst

[LangRef] Clarify in vscale_range that vscale is a power-of-two without the attribute (#183689)

Previously vscale_range used to add the constraint that vscale is a
power-of-two, but after #183080 it's already a power-of-two to begin
with.

This clarifies the sentence about assumptions when there is no attribute
DeltaFile
+1-1llvm/docs/LangRef.rst
+1-11 files

LLVM/project 1a6bd39flang/test/Lower volatile3.f90, flang/test/Lower/HLFIR goto-do-body.f90

[flang] Use CHECK-DAG to check constants (NFC) (#183687)

It is part of https://github.com/llvm/llvm-project/pull/180556, as a
separate NFC PR
DeltaFile
+4-4flang/test/Lower/volatile3.f90
+3-3flang/test/Lower/HLFIR/goto-do-body.f90
+7-72 files

LLVM/project 14f7334mlir/lib/Analysis/DataFlow IntegerRangeAnalysis.cpp, mlir/test/Dialect/Arith int-range-narrowing.mlir

[mlir][dataflow] Fix crash in IntegerRangeAnalysis with non-constant loop bounds (#183660)

When visiting non-control-flow arguments of a LoopLikeOpInterface op,
IntegerRangeAnalysis assumed that getLoopLowerBounds(),
getLoopUpperBounds(), and getLoopSteps() always return non-null values
when getLoopInductionVars() is non-null. This assumption is incorrect:
for example, AffineForOp returns nullopt from getLoopUpperBounds() when
the upper bound is not a constant affine expression (e.g., a dynamic
index from a tensor.dim).

Fix this by checking whether the bound optionals are engaged before
dereferencing them and falling back to the generic analysis if any bound
is unavailable.

Fixes #180312
DeltaFile
+15-4mlir/lib/Analysis/DataFlow/IntegerRangeAnalysis.cpp
+14-0mlir/test/Dialect/Arith/int-range-narrowing.mlir
+29-42 files

LLVM/project c5c0fe6llvm/lib/Transforms/Vectorize VPlanTransforms.cpp

[VPlan] Remove non-power-of-2 scalable VF comment. NFC (#183719)

No longer holds after #183080
DeltaFile
+0-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+0-21 files

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

[mlir][affine] Fix crash in linearize_index fold when basis is ub.poison (#183650)

`foldCstValueToCstAttrBasis` iterates the folded dynamic basis values
and erases any operand whose folded attribute is non-null (i.e., was
constant- folded). When an operand folds to `ub.PoisonAttr`, the
attribute is non-null so the operand was erased from the dynamic operand
list. However, `getConstantIntValue` on the corresponding `OpFoldResult`
in `mixedBasis` returns `std::nullopt` for poison (it is not an integer
constant), so the position was left as `ShapedType::kDynamic` in the
returned static basis.

This left the op in an inconsistent state: the static basis claimed one
more dynamic entry than actually existed. A subsequent call to
`getMixedBasis()` triggered the assertion inside `getMixedValues`.

Fix by skipping poison attributes in the erasure loop, treating them
like non-constant values. This keeps the dynamic operand and its
matching `kDynamic` entry in the static basis consistent.

Fixes #179265
DeltaFile
+14-0mlir/test/Dialect/Affine/canonicalize.mlir
+6-2mlir/lib/Dialect/Affine/IR/AffineOps.cpp
+20-22 files

LLVM/project 4dfdfbfllvm/include/llvm/Analysis ScalarEvolutionExpressions.h, llvm/lib/Transforms/Scalar LoopFuse.cpp LoopPredication.cpp

!fixup address latest comments, thanks
DeltaFile
+18-20llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+3-3llvm/lib/Transforms/Scalar/LoopFuse.cpp
+1-4llvm/lib/Transforms/Scalar/LoopPredication.cpp
+1-4llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+1-4llvm/lib/Transforms/Scalar/StraightLineStrengthReduce.cpp
+1-2llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
+25-371 files not shown
+26-387 files

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

[SCEV] Introduce SCEVUse wrapper type (NFC)

Add SCEVUse as a PointerIntPair wrapper around const SCEV * to prepare
for storing additional per-use information.

This commit contains the mechanical changes of adding an intial SCEVUse
wrapper and updating all relevant interfaces to take SCEVUse. Note that
currently the integer part is never set, and all SCEVUses are
considered canonical.
DeltaFile
+280-246llvm/lib/Analysis/ScalarEvolution.cpp
+117-47llvm/include/llvm/Analysis/ScalarEvolution.h
+78-70llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
+36-29llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+25-26llvm/lib/Transforms/Scalar/NaryReassociate.cpp
+17-18llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+553-43622 files not shown
+656-52328 files

LLVM/project e7bc02dllvm/lib/Analysis ScalarEvolution.cpp, llvm/test/Analysis/ScalarEvolution trip-count-scalable-stride.ll

[SCEV] Always return true for isKnownToBeAPowerOfTwo for SCEVVScale (#183693)

After #183080 vscale is always a power of two, so we don't need to check
for the vscale_range attribute.
DeltaFile
+34-0llvm/test/Analysis/ScalarEvolution/trip-count-scalable-stride.ll
+3-3llvm/lib/Analysis/ScalarEvolution.cpp
+37-32 files