LLVM/project 9bff593 — mlir/lib/Conversion/VectorToGPU VectorToGPU.cpp, mlir/test/Conversion/VectorToGPU vector-to-mma-ops.mlir vector-to-mma-ops-mma-sync.mlir

[mlir][vector-to-gpu] Do not convert ops masked by vector.mask (#226548)

A `vector.transfer_write` inside a `vector.mask` has no mask operand.
Since the write has no results, the `vector.mask` is not included in the
MMA conversion slice, and the write is converted inside the mask region,
producing invalid IR on both the `gpu.subgroup_mma` and NVGPU paths.

Treat operations for which `MaskableOpInterface::isMasked()` is true as
unsupported by MMA conversion. This leaves the entire slice unconverted.

The two paths differ in what masking support would require. On the
`gpu.subgroup_mma` path, the write becomes
`gpu.subgroup_mma_store_matrix`, which has no mask operand, so the
current conversion cannot preserve the mask. On the NVGPU path, the
write becomes per-lane `vector.store` operations, which could in
principle be replaced by `vector.maskedstore` operations with masks
derived from the fragment layout. This patch does not implement that and
bails out on both paths.


    [4 lines not shown]
DeltaFile
+26-0mlir/test/Conversion/VectorToGPU/vector-to-mma-ops-mma-sync.mlir
+25-0mlir/test/Conversion/VectorToGPU/vector-to-mma-ops.mlir
+6-0mlir/lib/Conversion/VectorToGPU/VectorToGPU.cpp
+57-03 files

LLVM/project b271d7c — llvm/test/Transforms/SLPVectorizer/AArch64 copyable-lane-external-use.ll

[SLP][NFC]Add an extra test with copyable extract, NFC



Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/235774
DeltaFile
+133-0llvm/test/Transforms/SLPVectorizer/AArch64/copyable-lane-external-use.ll
+133-01 files

LLVM/project ebf119a — clang/include/clang/CIR/Dialect/IR CIROps.td, clang/lib/CIR/Dialect/IR CIRDialect.cpp CIRTypes.cpp

[CIR] Admit only CIR types as nested CIR types (#233846)

FuncType::verify required every type reachable from a signature to be a
CIR type, and proved it with a deep walk on every !cir.func
construction.
#232863 memoized the walk in the dialect behind a mutex, but a record
that is still incomplete cannot be cached, and during CIRGen most of
them
are.

The walk was needed because !cir.ptr, !cir.array, !cir.data_member,
!cir.bitfield and the record types took unconstrained mlir::Type
parameters. Constrain them to CIR types instead. Each type then checks
only its own parameters, a CIR type holds only CIR types at any depth,
and FuncType::verify checks only its inputs and result. The walk, the
cache and the mutex go away.

- Pointee and data member types use a new CIR_DialectType constraint,
  and the array element constraint now requires it too.

    [19 lines not shown]
DeltaFile
+111-0clang/unittests/CIR/RecordTypeVerifyTest.cpp
+47-0clang/test/CIR/IR/invalid-nested-types.cir
+21-21clang/include/clang/CIR/Dialect/IR/CIROps.td
+26-16clang/lib/CIR/Dialect/IR/CIRTypes.cpp
+0-34clang/test/CIR/IR/invalid-func.cir
+1-28clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+206-998 files not shown
+255-12714 files

LLVM/project 306b8ed — llvm/lib/Transforms/Scalar SROA.cpp, llvm/test/CodeGen/AArch64 sve-intrinsics-and-not.ll

Rebase, address comments

Created using spr 1.3.7
DeltaFile
+1,665-0llvm/test/CodeGen/RISCV/GlobalISel/half-convert.ll
+1,452-0llvm/test/CodeGen/RISCV/GlobalISel/double-convert.ll
+1,190-0llvm/test/CodeGen/RISCV/GlobalISel/float-convert.ll
+346-28mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
+295-0llvm/test/CodeGen/AArch64/sve-intrinsics-and-not.ll
+121-97llvm/lib/Transforms/Scalar/SROA.cpp
+5,069-12591 files not shown
+6,858-97997 files

LLVM/project b0595c9 — llvm/lib/Transforms/Scalar LoopInterchange.cpp

[LoopInterchange] Look up loop cache costs by original loop (NFC)

Part of #235496

A later patch will change which IVs a Loop object holds. Therefore,
change the way CacheCost is looked up so that it does not depend on
the correspondence between IVs and Loop objects.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+29-7llvm/lib/Transforms/Scalar/LoopInterchange.cpp
+29-71 files

LLVM/project bc0e355 — llvm/lib/Target/AMDGPU SIInstrInfo.cpp, llvm/test/CodeGen/AMDGPU remat-smrd.mir machine-scheduler-sink-trivial-remats.mir

[AMDGPU][Codegen] Don't incorrectly shrink `S_LOAD_DWORDX{16,8}_IMM` during remat  (#225209)

This came up after #214725 but is a separate issue.

`SIInstrInfo::reMaterialize` should not shrink the width of
`S_LOAD_DWORDX{16,8}_IMM` if

1. `UsedLanes` is the full lanemask, keeping this consistent with
`S_MOV_64` handling after #184333,
2. or if there is more than one user of the rematerialized register. The
current implementation only checks that the instruction being
rematerialized before has a single use of the register.

The added test fails without this patch because of the incorrect
one-user check (the load is shrunk despite the full register width being
used).
DeltaFile
+92-0llvm/test/CodeGen/AMDGPU/machine-scheduler-sink-trivial-remats.mir
+34-4llvm/test/CodeGen/AMDGPU/remat-smrd.mir
+11-17llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+137-213 files

LLVM/project b5122d6 — clang/include/clang/CIR MissingFeatures.h, clang/lib/CIR/CodeGen CIRGenModule.cpp

[CIR][CUDA][HIP] Skip alias emission when the aliasee is not emitted (#234627)

Copy shouldSkipAliasEmission from classic codegen

Without it, device code emits host-only aliases, which fail translation
on spirv64-amd
DeltaFile
+65-0clang/test/CIR/CodeGenHIP/hip-weak-alias.hip
+34-3clang/lib/CIR/CodeGen/CIRGenModule.cpp
+30-0clang/test/CIR/CodeGenOpenMP/weak-alias.c
+4-0clang/test/CIR/CodeGenHIP/spirv-constant-addrspace.hip
+0-1clang/include/clang/CIR/MissingFeatures.h
+133-45 files

LLVM/project 8ac612d — libc/src/__support/CPP CMakeLists.txt unique_ptr.h, libc/test/src/__support/CPP CMakeLists.txt unique_ptr_test.cpp

Revert "[libc] Assert non-nullness in cpp::unique_ptr dereference operators" (#235768)

Reverts llvm/llvm-project#235658: breaks under ASAN.
DeltaFile
+0-24libc/test/src/__support/CPP/unique_ptr_test.cpp
+2-10libc/src/__support/CPP/unique_ptr.h
+0-1libc/test/src/__support/CPP/CMakeLists.txt
+0-1libc/src/__support/CPP/CMakeLists.txt
+2-364 files

LLVM/project cce09f1 — llvm/lib/Transforms/Scalar LoopStrengthReduce.cpp, llvm/test/Transforms/LoopStrengthReduce/X86 lcssa-preservation-regression.ll

[LSR] Fix LCSSA preservation in RewriteForPHI (#235361)

There was a call to SplitLandingPadPredecessors that did not specify
LCSSA preservation. Set it to ShouldPreserveLCSSA so we preserve LCSSA
here in the NewPM.

Found when doing a build of the LLVM test-suite with LCSSA preservation
enabled for LSR. This was not found in my initial testing (bootstrapping
LLVM) given we compile with -fno-exceptions.

Assisted-by: LLM
DeltaFile
+61-0llvm/test/Transforms/LoopStrengthReduce/X86/lcssa-preservation-regression.ll
+2-1llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+63-12 files

LLVM/project 063d481 — llvm/test/Transforms/LoopInterchange loop-control-available-in-outer-preheader.ll

Revert "[LoopInterchange] Add tests for loop control values in the outer preheader (NFC)" (#235753)

Reverts llvm/llvm-project#235520
As the test fails with EXPENSIVE_CHECK (ref:
https://github.com/llvm/llvm-project/pull/235520#issuecomment-6409222074)
DeltaFile
+0-126llvm/test/Transforms/LoopInterchange/loop-control-available-in-outer-preheader.ll
+0-1261 files

LLVM/project 6f3c296 — libc/src/__support/CPP CMakeLists.txt unique_ptr.h, libc/test/src/__support/CPP CMakeLists.txt unique_ptr_test.cpp

Revert "[libc] Assert non-nullness in cpp::unique_ptr dereference operators (…"

This reverts commit 3cc611bd820a424170a5cbb9b4f0d0cbacd43192.
DeltaFile
+0-24libc/test/src/__support/CPP/unique_ptr_test.cpp
+2-10libc/src/__support/CPP/unique_ptr.h
+0-1libc/test/src/__support/CPP/CMakeLists.txt
+0-1libc/src/__support/CPP/CMakeLists.txt
+2-364 files

LLVM/project 9fde1dd — libc/src/__support/math tanpif.h tanpif16.h, libc/test/src/math/smoke tanpif_test.cpp tanpif16_test.cpp

[libc][math] Fix `tanpif` and `tanpif16` error handling (#235296)

Relates to
https://github.com/llvm/llvm-project/pull/147192#issuecomment-5726874002.

- Set ERANGE when tanpif and tanpif16 underflow.
- Set ERANGE instead of EDOM at half-integer poles.
- Raise underflow and inexact exceptions explicitly in tanpif16.
- Return exact results for odd multiples of one quarter without raising
inexact.

Tested both functions with CORE-MATH's exhaustive checker in all four
rounding modes. With `CORE_MATH_SUPPORT_ERRNO` and
`CORE_MATH_CHECK_INEXACT` enabled.
DeltaFile
+16-5libc/src/__support/math/tanpif16.h
+14-5libc/src/__support/math/tanpif.h
+12-0libc/test/src/math/smoke/tanpif16_test.cpp
+11-0libc/test/src/math/smoke/tanpif_test.cpp
+53-104 files

LLVM/project 85c5c70 — llvm/lib/Transforms/InstCombine InstCombineAddSub.cpp

[InstCombine] Remove redundant add one folds (#235664)

These are fully subsumed by the `sext(bool) + C -> bool ? C - 1 : C` and
`(iN X s>> (N - 1)) + 1 --> zext (X > -1)` folds higher up in the
function.
DeltaFile
+0-20llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
+0-201 files

LLVM/project 428bd88 — llvm/lib/CodeGen CodeGenPrepare.cpp

[CGP] Remove handling of lifetime.end via bitcast (NFC) (#235712)

Nowadays lifetimes are required to have a direct alloca argument,
there cannot be a bitcast in between.
DeltaFile
+1-11llvm/lib/CodeGen/CodeGenPrepare.cpp
+1-111 files

LLVM/project 8b880cd — llvm/lib/IR Constants.cpp

[IR] Remove handling for removed constant expressions (NFC) (#235702)

Support for these casts as constant expressions has been dropped,
so don't handle them in getWithOperands().
DeltaFile
+0-8llvm/lib/IR/Constants.cpp
+0-81 files

LLVM/project 2a998ef — utils/bazel/llvm-project-overlay/libc/test/src/math/smoke BUILD.bazel

Fix bazel.
DeltaFile
+0-1utils/bazel/llvm-project-overlay/libc/test/src/math/smoke/BUILD.bazel
+0-11 files

LLVM/project ce1895c — llvm/test/CodeGen/AMDGPU memory-legalizer-global-agent.ll memory-legalizer-flat-system.ll

[AMDGPU] GFX125x: Relax global_inv/wb when NC MTYPE is not used

When the driver doesn't use MTYPE NC on gfx125x, the hardware ensures coherency
of the L2 caches. Then, the global_inv/wb instructions we emit only need to
reach the L2s to acquire/release data to device or system scope.

That's the case for gfx1250, gfx1250-strict, and gfx1251. gfx12-5-generic is
intentionally left out.
DeltaFile
+124-372llvm/test/CodeGen/AMDGPU/flat-saddr-atomics.ll
+107-321llvm/test/CodeGen/AMDGPU/global-atomicrmw-fadd.ll
+62-251llvm/test/CodeGen/AMDGPU/wait-xcnt-atomic-rmw-optimization.ll
+68-242llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-system.ll
+68-242llvm/test/CodeGen/AMDGPU/memory-legalizer-flat-agent.ll
+68-239llvm/test/CodeGen/AMDGPU/memory-legalizer-global-agent.ll
+497-1,66717 files not shown
+849-2,67323 files

LLVM/project 2941901 — llvm/lib/Target/SPIRV SPIRVLegalizerInfo.cpp, llvm/test/CodeGen/SPIRV/llvm-intrinsics is_fpclass.ll

[SPIR-V] Avoid dead OpLogicalOr with false in legalizeIsFPClass (#216639)
DeltaFile
+35-60llvm/test/CodeGen/SPIRV/llvm-intrinsics/is_fpclass.ll
+5-3llvm/lib/Target/SPIRV/SPIRVLegalizerInfo.cpp
+40-632 files

LLVM/project a938d86 — llvm/lib/Analysis Loads.cpp, llvm/unittests/Analysis LoadsTest.cpp

[Loads] Sign-extend narrow constant GEP indices in decomposeLinearExpression (#235092)

Constant GEP indices narrower than the index type were multiplied by the
stride without being widened, which asserted on mismatched APInt widths.
DeltaFile
+18-0llvm/unittests/Analysis/LoadsTest.cpp
+3-2llvm/lib/Analysis/Loads.cpp
+21-22 files

LLVM/project b924930 — clang/test/CodeGen/RISCV rvp-intrinsics.c, llvm/test/CodeGen/AMDGPU/GlobalISel legalize-llvm.amdgcn.image.sample.a16.ll legalize-llvm.amdgcn.image.dim.a16.ll

Rebase, address comments

Created using spr 1.3.7
DeltaFile
+9,687-0llvm/test/TableGen/x86-fold-tables.inc
+2,850-48clang/test/CodeGen/RISCV/rvp-intrinsics.c
+2,112-452llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.dim.a16.ll
+1,740-729llvm/test/CodeGen/X86/bfloat.ll
+1,222-1,222llvm/test/CodeGen/AMDGPU/GlobalISel/legalize-llvm.amdgcn.image.sample.a16.ll
+1,060-1,060llvm/test/Transforms/Util/DeclareRuntimeLibcalls/aarch64.ll
+18,671-3,5112,188 files not shown
+119,492-42,2142,194 files

LLVM/project 1571faa — llvm/lib/Transforms/Vectorize VPlan.h

Use cast
DeltaFile
+2-4llvm/lib/Transforms/Vectorize/VPlan.h
+2-41 files

LLVM/project 0157483 — libc/src/__support/OSUtil/linux/syscall_wrappers CMakeLists.txt epoll_pwait2.h, libc/src/sys/epoll/linux epoll_pwait2.cpp CMakeLists.txt

[libc] Use a syscall wrapper for `epoll_pwait2` (#235701)

This PR move `epoll_pwait2` behind the centralized syscall wrappers,
following `libc/docs/dev/syscall_wrapper_refactor.md`.

And slightly make the cmake and bazel target more sorted.
DeltaFile
+40-23utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+42-0libc/src/__support/OSUtil/linux/syscall_wrappers/epoll_pwait2.h
+18-18libc/src/sys/epoll/linux/CMakeLists.txt
+7-15libc/src/sys/epoll/linux/epoll_pwait2.cpp
+16-0libc/src/__support/OSUtil/linux/syscall_wrappers/CMakeLists.txt
+123-565 files

LLVM/project aa5c7b7 — utils/bazel/llvm-project-overlay/mlir BUILD.bazel

[Bazel] Fixes 220dd61 (#235680)

This fixes 220dd616279c15d28488e6a3cf74e4b040b27312 (#235655).

Buildkite error link:
https://buildkite.com/llvm-project/upstream-bazel/builds?commit=220dd616279c15d28488e6a3cf74e4b040b27312

Co-authored-by: Google Bazel Bot <google-bazel-bot at google.com>
DeltaFile
+2-0utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+2-01 files

LLVM/project 46d6fd9 — mlir/lib/Dialect/Index/IR IndexOps.cpp, mlir/test/Dialect/Index index-canonicalize.mlir

[MLIR][Index] Restrict subtraction comparison canonicalization (#216831)

Fix the unsafe canonicalization of ordered comparisons involving
`index.sub`.

Ordered comparisons may change semantics when the subtraction wraps, so
the
rewrite is now restricted to `eq` and `ne`.

For example, at a 32-bit index width, let `x = -2^31` and `y = 1`.
Then `x - y` wraps to `2^31 - 1`, so `(x - y) < 0` is false while
`x < y` is true.

Regression tests cover ordered comparisons while preserving the valid
`eq` and
`ne` canonicalizations.

Fixes #216042


    [2 lines not shown]
DeltaFile
+34-4mlir/test/Dialect/Index/index-canonicalize.mlir
+13-3mlir/lib/Dialect/Index/IR/IndexOps.cpp
+47-72 files

LLVM/project d8677a4 — llvm/lib/Frontend/OpenMP OMPIRBuilder.cpp, llvm/unittests/Frontend OpenMPIRBuilderTest.cpp

[Frontend] Do not check result of getTerminator. NFC. (#232764)

Since #189416 BasicBlock::getTerminator cannot return nullptr.
DeltaFile
+7-6llvm/unittests/Frontend/OpenMPIRBuilderTest.cpp
+1-2llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+8-82 files

LLVM/project 1c78023 — llvm/test/Transforms/LoopInterchange loop-control-available-in-outer-preheader.ll

Revert "[LoopInterchange] Add tests for loop control values in the outer preh…"

This reverts commit 60e80af877a7e9683eeea5e05f332767a76c0321.
DeltaFile
+0-126llvm/test/Transforms/LoopInterchange/loop-control-available-in-outer-preheader.ll
+0-1261 files

LLVM/project ced508f — llvm/lib/Target/AArch64/GISel AArch64LegalizerInfo.cpp, llvm/test/CodeGen/AArch64 overflow-vec.ll

[AArch64][GlobalISel] Split wide G_SMULH/G_UMULH instead of lowering them (#235327)

Vector `G_SMULH`/`G_UMULH` wider than 128 bits were lowered to widening
multiplies and shifts. This splits them into legal 128-bit pieces first,
as `G_MUL` already does, so they select to `smull`/`umull` pairs and
`uzp2`.

For example, `udiv <8 x i32>` by a constant:

```
define <8 x i32> @test(<8 x i32> %x) {
  %r = udiv <8 x i32> %x, <i32 7, i32 6, i32 7, i32 6, i32 7, i32 6, i32 7, i32 6>
  ret <8 x i32> %r
}
```

goes from 27 instructions to 22, now identical to SelectionDAG: the
half-register extractions (`mov d2, v0.d[1]`, ...) are gone and the
multiply-highs use `umull2`.
DeltaFile
+126-0llvm/test/CodeGen/AArch64/GlobalISel/legalize-mul.mir
+42-48llvm/test/CodeGen/AArch64/overflow-vec.ll
+56-0llvm/test/CodeGen/AArch64/GlobalISel/combine-udiv.ll
+3-0llvm/lib/Target/AArch64/GISel/AArch64LegalizerInfo.cpp
+227-484 files

LLVM/project 2ac6a2f — clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/test/CIR/Transforms remove-dead-values-try.cir

[CIR] Fix cir.try successor regions

`TryOp::getSuccessorRegions` sent every exit from the try region back to the
parent, so nothing led from the try region to the handlers. A `cir.resume`
ending the try region, left there once FlattenCFG has flattened an inner
cleanup scope, unwinds into a handler, and `CIRTryOpFlattening` branches it
to the handler dispatch block. Now every exit from the try region can enter
the handlers, and a `cir.resume` leaves the op only when there are none. The
parent keeps its edges to the handlers. An unwind out of a call in the try
region is not a region branch point, so these edges stand in for it, and
without them -remove-dead-values empties a handler that is reached only that
way.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+131-12clang/unittests/CIR/ControlFlowTest.cpp
+40-0clang/test/CIR/Transforms/remove-dead-values-try.cir
+30-8clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+201-203 files

LLVM/project b0589b5 — clang/lib/CIR/Dialect/IR CIRDialect.cpp, clang/test/CIR/Transforms remove-dead-values-cleanup-scope.cir

[CIR] Keep cir.cleanup.scope cleanup regions reachable

RegionBranchOpInterface::getSuccessorRegions must return every region that
may run next, but an unwind out of a call in the body, or a cir.return,
cir.break, cir.continue or cir.goto out of it, runs the cleanup without
passing a region branch point. A cleanup reached only that way had no
predecessor, so generic passes treated it as dead, and -remove-dead-values
erased an EH cleanup that stores to memory. Now the cleanup region is a
successor of the parent and of every body exit, and a body exit that the
cleanup kind does not cover can also leave the op.

Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+27-23clang/unittests/CIR/ControlFlowTest.cpp
+19-17clang/lib/CIR/Dialect/IR/CIRDialect.cpp
+33-0clang/test/CIR/Transforms/remove-dead-values-cleanup-scope.cir
+79-403 files

LLVM/project 1b6c091 — mlir/lib/Dialect/SCF/Transforms LoopSpecialization.cpp, mlir/test/Dialect/Linalg transform-op-peel-and-vectorize.mlir transform-op-peel-and-vectorize-conv.mlir

[mlir][scf] support back peeling of signed integer loops (#235260)

the signed split bound is now the arith chain instead of `affine.max`
hence supporting peeling of signed non-index loops with dynamic bounds.

from #234435 

claude helped me with tests and comments
DeltaFile
+34-61mlir/lib/Dialect/SCF/Transforms/LoopSpecialization.cpp
+49-17mlir/test/Dialect/SCF/for-loop-peeling.mlir
+4-2mlir/test/Dialect/SparseTensor/sparse_vector_peeled.mlir
+2-3mlir/test/Dialect/Linalg/transform-op-peel-and-vectorize-conv.mlir
+2-2mlir/test/Dialect/Linalg/transform-op-peel-and-vectorize.mlir
+91-855 files