LLVM/project cf60af8llvm/lib/Target/AMDGPU GCNSchedStrategy.cpp GCNSchedStrategy.h, llvm/test/CodeGen/AMDGPU machine-scheduler-sink-trivial-remats-debug.mir machine-scheduler-sink-trivial-remats.mir

[AMDGPU][Scheduler] Revert all regions when remat fails to increase occ. (#177205)

When the rematerialization stage fails to increase occupancy in all
regions, the current implementation only reverts the effect of
re-scheduling in regions in which the increased occupancy target could
not be achieved. However, given that re-scheduling with a higher
occupancy target puts more pressure on the scheduler to achieve lower
maximum RP at the cost of potentially lower ILP as well, region
schedules made with higher occupancy targets are generally less
desirable if the whole function is not able to meet that target.
Therefore, if at least one region cannot reach its target, it makes
sense to revert re-scheduling in all affected regions to go back to a
schedule that was made with a lower occupancy target.

This implements such logic for the rematerialization stage, and adds a
test to showcase that re-scheduling is indeed interrupted/reverted as
soon as a re-scheduled region that does not meet the increased target
occupancy is encountered.


    [4 lines not shown]
DeltaFile
+118-0llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats-debug.mir
+58-17llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+15-15llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats.mir
+27-1llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+218-334 files

LLVM/project 9e5deb9clang-tools-extra/clang-tidy/modernize UseNullptrCheck.cpp

[clang-tidy] Speed up `modernize-use-nullptr` (#178829)

As noted in [this
comment](https://github.com/llvm/llvm-project/pull/178149#discussion_r2732896149),
it appears that registering one `anyOf(a, b, ...)` matcher is generally
slower than registering `a, b, ...` all individually. Applying that
knowledge to this check gives us an easy 3x speedup:
```txt
                    ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
Status quo:         0.3281 (  6.1%)   0.0469 (  5.2%)   0.3750 (  6.0%)   0.3491 (  5.5%)  modernize-use-nullptr
With this change:   0.0938 (  1.8%)   0.0156 (  1.8%)   0.1094 (  1.8%)   0.1260 (  2.1%)  modernize-use-nullptr
```
I'm not exactly sure *why* this works, but it seems pretty consistent.
I've seen a similar result trying this with `bugprone-infinite-loop`.
DeltaFile
+24-27clang-tools-extra/clang-tidy/modernize/UseNullptrCheck.cpp
+24-271 files

LLVM/project 6a18039lld/test/ELF aarch64-movw-error.s riscv-pcrel-hilo.s

[ELF,test] Improve riscv and aarch64 relocation error tests

Adopt modern test patterns for relocation overflow and alignment error
tests:

* Use `rm -rf %t && mkdir %t && cd %t` pattern for isolation. Use simple
  filenames (32.o, 64.o, out.32) instead of %t-prefixed names
* Use `--defsym` instead of external input files where possible
* Omit `-o /dev/null` for negative tests (implicit when errors occur)
* Add `--implicit-check-not=error:` to catch unexpected errors
DeltaFile
+21-21lld/test/ELF/aarch64-movw-error.s
+20-18lld/test/ELF/riscv-pcrel-hilo.s
+20-18lld/test/ELF/riscv-branch.s
+19-18lld/test/ELF/riscv-jal.s
+17-19lld/test/ELF/aarch64-prel32.s
+17-19lld/test/ELF/aarch64-prel16.s
+114-1137 files not shown
+192-19213 files

LLVM/project acb2312llvm/test/Transforms/LowerMatrixIntrinsics multiply-fused-loops-large-matrixes.ll

[Matrix] Update test to make sure tiled loops can be used. (NFC)

The 6x6x6 and 7x7x7 matrix multiply used previously could not
use tiled loop codegen. Update to 8x8x8 and forced tile-size of 2.
DeltaFile
+2,816-1,702llvm/test/Transforms/LowerMatrixIntrinsics/multiply-fused-loops-large-matrixes.ll
+2,816-1,7021 files

LLVM/project b0d95f0llvm/lib/Transforms/Vectorize VPlanUtils.cpp

[VPlan] Handle Mul/UDiv in getSCEVExprForVPValue (NFCI).

Support Mul/UDiv and AND-variant (https://alive2.llvm.org/ce/z/rBJVdg)
in getSCEVExprForVPValue.

This is used in code paths when computing SCEV expressions in the
VPlan-based cost model, which should produce costs matching the legacy
cost model.
DeltaFile
+16-0llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+16-01 files

LLVM/project 8b3b0b8llvm/lib/Target/AMDGPU SIInsertWaitcnts.cpp

[AMDGPU][SIInsertWaitcnt][NFC] Replace if/else with switch (#178956)

This is an NFC patch that replaces the consecutive ifs and else ifs in
generateWaitcntInstBefore() with a switch. This makes it a bit easier to
read.
DeltaFile
+46-34llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
+46-341 files

LLVM/project 49e3ae6mlir/lib/Transforms/Utils DialectConversion.cpp

Use reportFatalInternalError in DialectConversion (#178612)

Migrate from deprecated report_fatal_error to reportFatalInternalError
in DialectConversion.cpp. All 6 instances are internal consistency
checks in MLIR's dialect conversion system, so reportFatalInternalError
is the appropriate replacement.

Part of #138914
DeltaFile
+15-12mlir/lib/Transforms/Utils/DialectConversion.cpp
+15-121 files

LLVM/project 020c846llvm/lib/Analysis ValueTracking.cpp, llvm/test/Transforms/Attributor/AMDGPU nofpclass-amdgcn-fract.ll

AMDGPU: Implement computeKnownFPClass for llvm.amdgcn.fract
DeltaFile
+66-0llvm/test/Transforms/Attributor/AMDGPU/nofpclass-amdgcn-fract.ll
+17-0llvm/lib/Analysis/ValueTracking.cpp
+83-02 files

LLVM/project fbf8683llvm/lib/Target/AMDGPU AMDGPUCodeGenPrepare.cpp, llvm/test/CodeGen/AMDGPU fract-match.ll

AMDGPU: Use SimplifyQuery in AMDGPUCodeGenPrepare

Enables assumes in more contexts. Of particular interest is the
nan check for the fract pattern.

The device libs f32 and s64 sin implementations have a range check,
and inside the large path this pattern appears. After a small patch
to invert this check to send nans down the small path, this will
enable the fold unconditionally on the large path.
DeltaFile
+79-0llvm/test/CodeGen/AMDGPU/fract-match.ll
+27-22llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+106-222 files

LLVM/project beb0e7ellvm/lib/Transforms/Vectorize VPlanTransforms.cpp, llvm/test/Transforms/LoopVectorize binop-folds.ll hoist-predicated-loads-with-predicated-stores.ll

[VPlan] Fold (x | !x) -> true. (#177887)

PR: https://github.com/llvm/llvm-project/pull/177887
DeltaFile
+39-0llvm/test/Transforms/LoopVectorize/binop-folds.ll
+2-4llvm/test/Transforms/LoopVectorize/hoist-predicated-loads-with-predicated-stores.ll
+6-0llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+1-3llvm/test/Transforms/LoopVectorize/cse-replicate-regions.ll
+48-74 files

LLVM/project 91c42fellvm/lib/Target/Hexagon HexagonVectorCombine.cpp

[Hexagon] Track type locally in HexagonVectorCombine (#179066)

Replace getAllocatedType calls with tracked types from alloca creation.
The types are known at the CreateAlloca call sites, so we track them
locally instead of re-querying through getAllocatedType, to facilitate
someday possibly removing getAllocatedType from the API of AllocaInst.

Co-authored-by: Claude Sonnet 4.5 <noreply at anthropic.com>
DeltaFile
+8-8llvm/lib/Target/Hexagon/HexagonVectorCombine.cpp
+8-81 files

LLVM/project 1721b9fllvm/lib/Target/DirectX DXILDataScalarization.cpp

[DirectX] remove getAllocatedType in DXILDataScalarization (#179067)

Update dynamicallyLoadArray to take the allocated type as a parameter
instead of querying getAllocatedType. This is to facilitate removing
other incorrect uses of getAllocatedType, and eventually possibly even
getAllocatedType itself.

Co-authored-by: Claude Sonnet 4.5 <noreply at anthropic.com>
DeltaFile
+13-12llvm/lib/Target/DirectX/DXILDataScalarization.cpp
+13-121 files

LLVM/project 0b4fbc5llvm/test/Transforms/SLPVectorizer/X86 shl-compatible-with-add.ll

[SLP][NFC]Add a test to check modeling shl x, 1 as add x,x, NFC
DeltaFile
+64-0llvm/test/Transforms/SLPVectorizer/X86/shl-compatible-with-add.ll
+64-01 files

LLVM/project 2f09bd2lld/test/ELF relocation-nocopy.s hidden-shared-err.s

[ELF,test] Improve error/warning message checks

Update tests to include proper `error:` or `warning:` prefixes and
file/section information in CHECK patterns. Add
--implicit-check-not=error: to ensure no unexpected errors are produced.
DeltaFile
+6-6lld/test/ELF/relocation-nocopy.s
+5-5lld/test/ELF/hidden-shared-err.s
+5-5lld/test/ELF/aarch64-lo12-alignment.s
+5-5lld/test/ELF/arm-adr-err-long.s
+4-4lld/test/ELF/arm-adr-err.s
+4-4lld/test/ELF/relocation-past-merge-end.s
+29-2942 files not shown
+117-11448 files

LLVM/project adaa3e7libc/src/__support/math sincosf_utils.h sincosf_float_eval.h

[libc] Address sincosf size bloat (#179004)

The recent refactoring in #177523 marked some functions as static which
increased the size of sinf/cosf functions. Removing the static storage
for these functions to remove the bloat which is especially problematic
in size constrained baremetal target builds.
DeltaFile
+8-9libc/src/__support/math/sincosf_utils.h
+3-3libc/src/__support/math/sincosf_float_eval.h
+1-1libc/src/__support/math/sincosf.h
+12-133 files

LLVM/project 9065730lld/test/ELF aarch64-movw-error.s arm-tag-vfp-args-errs.s

[ELF,test] Improve error message checks with proper format

Update tests to use the canonical error message format with `error:`
prefix and file:section information. Add `--implicit-check-not=error:`
to ensure no unexpected errors are produced.

This commit focuses on "out of range" and "not aligned" errors.
DeltaFile
+19-19lld/test/ELF/aarch64-movw-error.s
+15-17lld/test/ELF/arm-tag-vfp-args-errs.s
+3-3lld/test/ELF/ppc64-error-missaligned-dq.s
+3-3lld/test/ELF/ppc64-error-missaligned-ds.s
+3-3lld/test/ELF/ppc64-reloc-pcrel34-overflow.s
+2-2lld/test/ELF/aarch64-load-alignment.s
+45-473 files not shown
+50-529 files

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

[mlir][WIP] `DenseElementsAttr` generalized
DeltaFile
+155-1mlir/lib/AsmParser/AttributeParser.cpp
+76-0mlir/include/mlir/IR/BuiltinTypeInterfaces.td
+57-15mlir/lib/IR/AsmPrinter.cpp
+28-0mlir/test/lib/Dialect/Test/TestTypes.cpp
+28-0mlir/test/IR/dense-elements-type-interface.mlir
+16-0mlir/test/lib/Dialect/Test/TestTypeDefs.td
+360-165 files not shown
+379-1611 files

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

Early return and reduce indent
DeltaFile
+8-8llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+8-81 files

LLVM/project 17aa4a4llvm/lib/Target/AMDGPU GCNSchedStrategy.h GCNSchedStrategy.cpp

Format and switch to ArrayRef
DeltaFile
+1-2llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+1-1llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+2-32 files

LLVM/project 0307f77llvm/lib/Target/AMDGPU GCNSchedStrategy.cpp GCNSchedStrategy.h, llvm/test/CodeGen/AMDGPU machine-scheduler-sink-trivial-remats-debug.mir machine-scheduler-sink-trivial-remats.mir

[AMDGPU][Scheduler] Revert all regions when remat fails to increase occ.

When the rematerialization stage fails to increase occupancy in all
regions, the current implementation only reverts the effect of
re-scheduling in regions in which the increased occupancy target could
not be achieved. However, given that re-scheduling with a higher
occupancy target puts more pressure on the scheduler to achieve lower
maximum RP at the cost of potentially lower ILP as well, region
schedules made with higher occupancy targets are generally less
desirable if the whole function is not able to meet that target.
Therefore, if at least one region cannot reach its target, it makes
sense to revert re-scheduling in all affected regions to go back to
a schedule that was made with a lower occupancy target.

This implements such logic for the rematerialization stage, and adds a
test to showcase that re-scheduling is indeed interrupted/reverted as
soon as a re-scheduled region that does not meet the increased target
occupancy is encountered.


    [5 lines not shown]
DeltaFile
+118-0llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats-debug.mir
+58-17llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+15-15llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats.mir
+28-1llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+219-334 files

LLVM/project 7274ae9llvm/lib/Target/AMDGPU GCNSchedStrategy.cpp GCNSchedStrategy.h, llvm/test/CodeGen/AMDGPU debug-value-scheduler.mir sema-v-unsched-bundle.ll

[AMDGPU][Scheduler] Simplify scheduling revert logic (#177203)

When scheduling must be reverted for a region, the current
implementation re-orders non-debug instructions and debug instructions
separately; the former in a first pass and the latter in a second pass
handled by a generic machine scheduler helper whose state is tied to the
current region being scheduled, in turns limiting the revert logic to
only work on the active scheduling region.

This makes the revert logic work in a single pass for all MIs, and
removes the restriction that it works exclusively on the active
scheduling region. The latter enables future use cases such as reverting
scheduling of multiple regions at once.
DeltaFile
+44-51llvm/lib/Target/AMDGPU/GCNSchedStrategy.cpp
+6-2llvm/lib/Target/AMDGPU/GCNSchedStrategy.h
+2-2llvm/test/CodeGen/AMDGPU/debug-value-scheduler.mir
+1-1llvm/test/CodeGen/AMDGPU/sema-v-unsched-bundle.ll
+53-564 files

LLVM/project 90b3712llvm/lib/Transforms/Vectorize VPlanTransforms.cpp LoopVectorize.cpp, llvm/test/Transforms/LoopVectorize/X86 reduction-crash.ll

Reapply "[VPlan] Detect and create partial reductions in VPlan. (NFCI) (#167851)"

This reverts commit d1e477b00b49c63ff4dd513eeb14a5b18bc055d7.

Recommit with a extra checks making sure extends are VPWidenCastRecipes,
rejecting VPReplicateRecipes.

Original message:
As a first step, move the existing partial reduction detection logic to
VPlan, trying to preserve the existing code structure & behavior as
closely as possible.

With this, partial reductions are detected and created together in a
single step.

This allows forming partial reductions and bundling them up if
profitable together in a follow-up.

PR: https://github.com/llvm/llvm-project/pull/167851
DeltaFile
+362-2llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+7-267llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+3-62llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h
+47-0llvm/test/Transforms/LoopVectorize/X86/reduction-crash.ll
+7-35llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+20-0llvm/lib/Transforms/Vectorize/VPlanUtils.h
+446-3665 files not shown
+493-36811 files

LLVM/project 1818b23llvm/lib/CodeGen/SelectionDAG DAGCombiner.cpp SelectionDAG.cpp, llvm/test/CodeGen/AArch64 sve-bf16-combines.ll

[SDAG] Check for `nsz` in DAG.canIgnoreSignBitOfZero() (#178905)

Follow up to #174423
DeltaFile
+16-18llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow-codegen.ll
+9-13llvm/test/CodeGen/RISCV/fma-combine.ll
+8-8llvm/test/CodeGen/AArch64/sve-bf16-combines.ll
+5-9llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+4-6llvm/test/CodeGen/AMDGPU/fneg-combines.new.ll
+5-0llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+47-542 files not shown
+50-578 files

LLVM/project 7c738camlir/include/mlir/Interfaces ExecutionProgressOpInterface.h, mlir/lib/Interfaces ExecutionProgressOpInterface.cpp

address comments
DeltaFile
+4-2mlir/include/mlir/Interfaces/ExecutionProgressOpInterface.h
+1-1mlir/lib/Interfaces/ExecutionProgressOpInterface.cpp
+5-32 files

LLVM/project 0280450llvm/test/tools/llvm-lipo create-archive-input.test, llvm/tools/llvm-lipo llvm-lipo.cpp

[llvm-lipo] Fix handling of archives in universal binaries (#176448)

When extracting slices from a universal binary, llvm-lipo was not
handling the case where the slice is an archive.

Fixes #90156
DeltaFile
+21-7llvm/tools/llvm-lipo/llvm-lipo.cpp
+9-0llvm/test/tools/llvm-lipo/create-archive-input.test
+30-72 files

LLVM/project 59f815bclang/bindings/python/clang cindex.py, clang/bindings/python/tests/cindex test_code_completion.py

[libclang/python] Deprecate CodeCompletionResults.results (#177764)

This partially addresses point 5 from
https://github.com/llvm/llvm-project/issues/156680.
DeltaFile
+18-0clang/bindings/python/clang/cindex.py
+10-1clang/bindings/python/tests/cindex/test_code_completion.py
+6-0clang/docs/ReleaseNotes.rst
+34-13 files

LLVM/project 49d2323llvm/lib/Target/X86 X86ISelLowering.cpp, llvm/test/CodeGen/X86 avx512-intrinsics.ll

[X86] getScalarMaskingNode - FIXUPIMM scalar ops take upper elements from second operand (#179101)

FIXUPIMMSS/SD instructions passthrough the SECOND operand upper elements, and not the first like most (2-op) instructions

Fixes #179057
DeltaFile
+6-4llvm/test/CodeGen/X86/avx512-intrinsics.ll
+6-4llvm/lib/Target/X86/X86ISelLowering.cpp
+12-82 files

LLVM/project 603b625llvm/include/llvm/CodeGen BasicTTIImpl.h, llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp

[Analysis] Add Intrinsics::CLMUL case to cost calculations to getIntrinsicInstrCost / getTypeBasedIntrinsicInstrCost (#176552)

This patch adds a case in getIntrinsicInstrCost and
getTypeBasedIntrinsicInstrCost in
llvm/include/llvm/CodeGen/BasicTTIImpl.h for Intrinsic::clmul. This
patch uses TLI->isOperationLegalOrCustom to check if the instruction is
cheap. If not cheap, it sums up the cost of the arithmetic operations
(AND, SHIFT, XOR) multiplied by the bit width.

Fixes #176354
DeltaFile
+26-0llvm/test/Analysis/CostModel/X86/clmul.ll
+17-0llvm/test/Analysis/CostModel/AArch64/clmul.ll
+12-0llvm/include/llvm/CodeGen/BasicTTIImpl.h
+3-0llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+58-04 files

LLVM/project d1e477bllvm/lib/Transforms/Vectorize VPlanTransforms.cpp LoopVectorize.cpp

Revert "[VPlan] Detect and create partial reductions in VPlan. (NFCI) (#167851)"

This reverts commit f4e8cc1a2229dca76d21c8d37439c4c194b06b86.

This change wasn't NFC; it causes failed asserts when building
ffmpeg for i686 windows, see
https://github.com/llvm/llvm-project/pull/167851 for details.
DeltaFile
+2-358llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp
+267-7llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+62-3llvm/lib/Transforms/Vectorize/VPRecipeBuilder.h
+35-7llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp
+0-20llvm/lib/Transforms/Vectorize/VPlanUtils.h
+0-17llvm/lib/Transforms/Vectorize/VPlanUtils.cpp
+366-4124 files not shown
+368-44210 files

LLVM/project d5711ddmlir/include/mlir/Dialect/UB/IR UBOps.td, mlir/lib/Dialect/UB/IR UBOps.cpp

[mlir][UB] Erase ops that precede `ub.unreachable`
DeltaFile
+37-0mlir/lib/Dialect/UB/IR/UBOps.cpp
+25-0mlir/test/Dialect/UB/canonicalize.mlir
+1-0mlir/include/mlir/Dialect/UB/IR/UBOps.td
+63-03 files