LLVM/project 8f1efc2llvm/lib/Transforms/Utils LoopSplitUtils.cpp

[Transforms][Utils] Preserve branch weights in LoopSplitUtils (#213626)

Carry the original latch's branch weights onto the clamped latch, and
mark the newly created partition-guard branches as having unknown
weights so profile-tracking passes are not misled.
DeltaFile
+15-2llvm/lib/Transforms/Utils/LoopSplitUtils.cpp
+15-21 files

LLVM/project 357f861flang/include/flang/Evaluate real.h logical.h, flang/lib/Evaluate character.h

Add [[maybe_unused]]
DeltaFile
+0-29flang/lib/Evaluate/character.h
+4-3flang/include/flang/Evaluate/real.h
+4-3flang/include/flang/Evaluate/logical.h
+4-3flang/include/flang/Evaluate/integer.h
+4-3flang/include/flang/Evaluate/complex.h
+16-415 files

LLVM/project 5daadaallvm/test/CodeGen/X86 avx512fp16-fminnum.ll avx512fp16-fmaxnum.ll

[X86] Add PSEUDO_FMIN/PSEUDO_FMAX to canCombineAsMaskOperation (#213475)

Add FP min/max opcodes to the list of operations that can be folded into
write-masked instructions. This allows commuteSelect to recognize these
operations and invert the setcc condition to enable ISel to match fused
vminps/vmaxps {%k} patterns.
DeltaFile
+71-38llvm/test/CodeGen/X86/fminnum.ll
+71-38llvm/test/CodeGen/X86/fmaxnum.ll
+22-23llvm/test/CodeGen/X86/vector-reduce-fmin.ll
+22-23llvm/test/CodeGen/X86/vector-reduce-fmax.ll
+15-20llvm/test/CodeGen/X86/avx512fp16-fminnum.ll
+15-20llvm/test/CodeGen/X86/avx512fp16-fmaxnum.ll
+216-1623 files not shown
+238-1869 files

LLVM/project b23ff02llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp SIInstrInfo.cpp, llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR as-vgpr-divergent.ll as-vgpr-gpr-idx-mode.ll

Pin VGPR-memory indexed accesses to EXEC and mark them divergent
DeltaFile
+14-14llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-gpr-idx-mode.ll
+7-8llvm/test/CodeGen/AMDGPU/AddressSpaceVGPR/as-vgpr-divergent.ll
+13-0llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+5-5llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+39-274 files

LLVM/project 4d98378flang/include/flang/Evaluate complex.h, flang/lib/Evaluate initial-image.cpp

Fix bounds access, explicit zero-pad
DeltaFile
+71-0flang/test/Evaluate/fold-transfer-partial.f90
+32-29flang/lib/Evaluate/initial-image.cpp
+1-1flang/include/flang/Evaluate/complex.h
+104-303 files

LLVM/project fb77712clang/lib/Basic/Targets SPIR.h, clang/lib/CodeGen/TargetBuiltins AMDGPU.cpp

[clang][AMDGPU] Widen ballot for read_exec_lo/hi to wavefront size (#212813)

GlobalISel cannot select a ballot narrower than the wavefront width,
since it can't represent one bit per lane

Widen the ballot to the wave size and narrow the result afterwards

This is a prerequisite for relanding
https://github.com/llvm/llvm-project/pull/211493 (reverted in
https://github.com/llvm/llvm-project/pull/212628 to unblock buildbot) to
prevent device libs side failures

---------

Co-authored-by: Matt Arsenault <arsenm2 at gmail.com>
DeltaFile
+10-2clang/lib/CodeGen/TargetBuiltins/AMDGPU.cpp
+2-3clang/test/CodeGenOpenCL/builtins-amdgcn.cl
+2-3clang/test/CodeGenOpenCL/builtins-amdgcn-wave64.cl
+4-0clang/lib/Basic/Targets/SPIR.h
+18-84 files

LLVM/project 80df471llvm/test/CodeGen/AMDGPU buffer-fat-pointer-atomicrmw-fmin.ll buffer-fat-pointer-atomicrmw-fadd.ll

Reland [MachineLICM] Use `RegisterClassInfo::getRegPressureSetLimit` (#213584)

This relands #211715 which was reverted because of some failures
in experimental targets and one AMDGPU test `diverged-entry-basic.ll`.

Below is the original commit message.

----

This recommits #119826, which taught `MachineLICM` to use
`RegisterClassInfo` when computing register pressure limits so
reserved registers are accounted for (#118787).

The original change was reverted by eeac0ff because it increased
compile time by causing repeated `RegisterClassInfo` computations.

This PR is based on #210826, in which `MachineRegisterClassInfo`
analysis pass was added. `MachineRegisterClassInfo` is required
by `MachineLICM` now, but the intervening machine passes that do

    [3 lines not shown]
DeltaFile
+3,809-3,814llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmin.ll
+3,809-3,814llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmax.ll
+3,465-3,511llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmin.ll
+3,465-3,511llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmax.ll
+3,299-3,240llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fadd.ll
+2,594-2,524llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmin.ll
+20,441-20,41468 files not shown
+47,317-46,31474 files

LLVM/project 2fe9fc9mlir/lib/Dialect/Bufferization/Transforms StaticMemoryPlannerAnalysis.cpp, mlir/test/Dialect/Bufferization/Transforms static-memory-planner-errors.mlir static-memory-planner-analysis.mlir

[mlir][bufferization] Handle arith.select-based deallocs in static memory planner (#209106)

The static memory planner currently skips any allocation that doesn't
have a direct `memref.dealloc` user. This is overly conservative, after
running `ownership-based-buffer-deallocation`, it's common to see
patterns like:

  `%2 = arith.select %c, %0, %1 : memref<1024xf32>`
  `memref.dealloc %2 : memref<1024xf32>`

where both `%0` and `%1` get skipped with `++numSkipNoDealloc` even
though their lifetimes are well-defined.

This patch teaches `collectCandidates` to follow `arith.select` chains
when looking for potential deallocs. We traverse the use-def graph
forward from each alloc, collecting any `memref.dealloc` ops reachable
through select results.

Since a single select-based dealloc can conditionally free one of

    [18 lines not shown]
DeltaFile
+94-49mlir/lib/Dialect/Bufferization/Transforms/StaticMemoryPlannerAnalysis.cpp
+64-31mlir/test/Dialect/Bufferization/Transforms/static-memory-planner-analysis.mlir
+24-0mlir/test/Dialect/Bufferization/Transforms/static-memory-planner-errors.mlir
+182-803 files

LLVM/project 9baf14fllvm/include/llvm/Analysis TargetLibraryInfo.h

[TLI] Update `getWCharSize` documentation (NFC) (#213622)

`return 0` part of `getWCharSize` was added in cc603ee3d563 but then
removed in 5a88dffc40d2. Update the documentation as it no longer
returns 0 when the size is unknown (instead returns the default).
DeltaFile
+1-1llvm/include/llvm/Analysis/TargetLibraryInfo.h
+1-11 files

LLVM/project 536acc2llvm/unittests/ExecutionEngine/Orc COFFAutoImportGeneratorTest.cpp

[ORC] Fix COFFAutoImportGeneratorTest on Darwin. (#213616)

Add linker-level mangling prefix for lookups on Darwin.

These should fix the build failures associated with PR203914 on Darwin,
e.g. https://lab.llvm.org/buildbot/#/builders/23/builds/21523
DeltaFile
+12-4llvm/unittests/ExecutionEngine/Orc/COFFAutoImportGeneratorTest.cpp
+12-41 files

LLVM/project 6617316llvm/lib/Target/X86 X86ISelLowering.cpp

X86: Defend against regression from SimplifyDemandedVectorElts load support (#213611)

It doesn't appear possible to test this independently.

Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
DeltaFile
+12-8llvm/lib/Target/X86/X86ISelLowering.cpp
+12-81 files

LLVM/project 667bc9dmlir/include/mlir/Dialect/SPIRV/IR SPIRVNonUniformOps.td, mlir/lib/Conversion/GPUToSPIRV GPUToSPIRV.cpp

[mlir][SPIR-V] Restrict GroupNonUniform ops to Subgroup scope (#213087)

spirv-val now limits execution scope for GroupNonUniform* ops to
Subgroup, except OpGroupNonUniformRotateKHR which still allows Workgroup
(see https://github.com/KhronosGroup/SPIRV-Tools/pull/6811). Tighten the
ODS trait accordingly and stop lowering GPU non-uniform reductions to a
Workgroup scope op

Follow-up to #212928
DeltaFile
+70-70mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir
+80-39mlir/test/Conversion/GPUToSPIRV/reductions.mlir
+51-51mlir/include/mlir/Dialect/SPIRV/IR/SPIRVNonUniformOps.td
+9-5mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
+4-4mlir/test/Conversion/ConvertToSPIRV/gpu.mlir
+1-1mlir/test/lib/Dialect/SPIRV/TestAvailability.cpp
+215-1703 files not shown
+218-1739 files

LLVM/project 1fe8f95

Revert "Disable this test on Darwin to give the author a chance to fix it." (#213624)

Reverts llvm/llvm-project#213388

#213605 fixes the test.
DeltaFile
+0-00 files

LLVM/project bd7433bclang/lib/Analysis/LifetimeSafety LoanPropagation.cpp

[clang][LifetimeSafety] Fix unnamed TimeTraceScope in computePersistentOrigins (#213521)

The TimeTraceScope was constructed as a temporary and destroyed
immediately, so the prepass was reported as taking ~0. It actually
accounts for ~14% of LoanPropagation in some cases.

Co-authored-by: Gabor Horvath <gaborh at apple.com>
DeltaFile
+1-1clang/lib/Analysis/LifetimeSafety/LoanPropagation.cpp
+1-11 files

LLVM/project 3ddaf72

Revert "Disable this test on Darwin to give the author a chance to fix it. (#…"

This reverts commit 956e24199792651f33b1cad39f611d5f03ba27b5.
DeltaFile
+0-00 files

LLVM/project 095ff52lldb/test/API/commands/register/register_command TestRegisters.py

[lldb] Fix test_case_insensitivity's register value for canonical/PAC constraints (#213605)

This addresses a test failure introduced in
4f6cf2c2072ccf5780ac30bf69ebf99b788dbd52.

`0x1122334455667788` is a non-canonical address on x86_64 (fails to
write to rsp) and gets its non-addressing bits masked off on read for
pc/lr/sp/fp on Darwin AArch64, so it doesn't round-trip on either. Zero
the top 20 bits to stay clear of both.
DeltaFile
+4-1lldb/test/API/commands/register/register_command/TestRegisters.py
+4-11 files

LLVM/project ba1c26cllvm/lib/Target/X86 X86FrameLowering.cpp, llvm/test/CodeGen/X86 swift-async.ll swift-async-cfi-prologue.ll

[X86] Fix missing CFI after the Swift async context push (#202570)

The Swift async prologue pushes the context slot (pushq %r14 / $0) but
doesn't touch the CFA until the later .cfi_def_cfa_register %rbp. So the
CFA still describes the stack from before the push and stays stale all
the way through the leaq and the subq. If something unwinds in that
window (debugger, profiler, signal) it reads the wrong slot. Normal
execution is fine.

FIX: account for the push with .cfi_adjust_cfa_offset 8, then switch to
an %rbp-relative CFA (.cfi_def_cfa %rbp, 16) right after the leaq and
before the subq, so the rule is correct before rsp moves again.

Adds swift-async-cfi-prologue.ll (directives + .eh_frame rows, plus a
locals case for the subq) and updates swift-async.ll.
DeltaFile
+41-0llvm/test/CodeGen/X86/swift-async-cfi-prologue.ll
+21-1llvm/lib/Target/X86/X86FrameLowering.cpp
+12-1llvm/test/CodeGen/X86/swift-async.ll
+74-23 files

LLVM/project 9b8c3b1llvm/lib/IR AutoUpgrade.cpp, llvm/unittests/Bitcode DataLayoutUpgradeTest.cpp

Add reserved AS to autoupgrade
DeltaFile
+31-19llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+4-2llvm/lib/IR/AutoUpgrade.cpp
+35-212 files

LLVM/project a9089a2llvm/lib/Target/AMDGPU AMDGPUMachineFunctionInfo.cpp, llvm/lib/TargetParser TargetDataLayout.cpp

Rebase + comments
DeltaFile
+7-7llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+4-4llvm/test/CodeGen/AMDGPU/s-barrier-signal-var-gep.ll
+1-4llvm/lib/Target/AMDGPU/AMDGPUMachineFunctionInfo.cpp
+2-1llvm/lib/TargetParser/TargetDataLayout.cpp
+14-164 files

LLVM/project a6b68b1llvm/docs AMDGPUUsage.rst, llvm/lib/IR Type.cpp

Comments
DeltaFile
+7-12llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp
+8-10llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+8-0llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+6-0llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+4-1llvm/docs/AMDGPUUsage.rst
+2-0llvm/lib/IR/Type.cpp
+35-233 files not shown
+38-269 files

LLVM/project cc77354llvm/lib/Target/AMDGPU AMDGPUMachineFunctionInfo.cpp, llvm/test/CodeGen/AMDGPU s-barrier-lowering-bad-absolute-symbol.ll null-named-barrier-gv.ll

comments
DeltaFile
+18-18llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+8-4llvm/lib/Target/AMDGPU/AMDGPUMachineFunctionInfo.cpp
+1-1llvm/test/CodeGen/AMDGPU/s-barrier-lowering-bad-absolute-symbol.ll
+1-1llvm/test/CodeGen/AMDGPU/null-named-barrier-gv.ll
+28-244 files

LLVM/project 7b340b1llvm/docs AMDGPUUsage.rst, llvm/lib/Target/AMDGPU AMDGPUMemoryUtils.cpp SIDefines.h

[AMDGPU] Add synthetic apertures and use them for barriers

Define what a synthetic aperture is, and adjust the barrier AS
to use this new system. This makes the barrier AS even safer to
use as now we can use all 32 bits of it without ever risking
hitting a valid address of any kind (LDS or outside LDS).
DeltaFile
+72-87llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+44-5llvm/docs/AMDGPUUsage.rst
+21-23llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+18-17llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+12-0llvm/lib/Target/AMDGPU/SIDefines.h
+9-0llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+176-1324 files not shown
+186-13710 files

LLVM/project f78ad7dlld/test/ELF/lto amdgpu.ll, llvm/lib/IR AutoUpgrade.cpp

Add DL auto-upgrade
DeltaFile
+19-11llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+4-0llvm/lib/IR/AutoUpgrade.cpp
+1-1lld/test/ELF/lto/amdgpu.ll
+24-123 files

LLVM/project 7d33b56llvm/docs AMDGPUUsage.rst

Comments
DeltaFile
+1-1llvm/docs/AMDGPUUsage.rst
+1-11 files

LLVM/project 21e62e0llvm/lib/Target/AMDGPU SIISelLowering.cpp AMDGPUMemoryUtils.h, llvm/test/CodeGen/AMDGPU addrspacecast-barrier.ll

Comments
DeltaFile
+4-3llvm/lib/Target/AMDGPU/SIDefines.h
+1-3llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+1-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+1-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+9-106 files

LLVM/project ee67265llvm/docs AMDGPUUsage.rst

Update docs
DeltaFile
+20-13llvm/docs/AMDGPUUsage.rst
+20-131 files

LLVM/project 82714f8llvm/lib/IR AutoUpgrade.cpp, llvm/unittests/Bitcode DataLayoutUpgradeTest.cpp

Fix Autoupgrade
DeltaFile
+7-5llvm/lib/IR/AutoUpgrade.cpp
+4-2llvm/unittests/Bitcode/DataLayoutUpgradeTest.cpp
+11-72 files

LLVM/project 1b39f13llvm/lib/Target/AMDGPU AMDGPULegalizerInfo.cpp SIISelLowering.cpp, llvm/test/CodeGen/AMDGPU amdgpu-lower-exec-sync.ll s-barrier.ll

[RFC][AMDGPU] Add BARRIER address space

Add a new BARRIER address space that is used for global variables that are used to represent the barrier IDs in GFX12.5.

These barrier addresses just have values corresponding 1-1 to barrier IDs. They are still implemented on top of LDS, but the offsetting happens during an addrspacecast to generic, not whenever the barrier GV is used.

The motivation for this is to make the relation between LDS and barrier GVs explicit in the compiler. It does add a bit more complexity, but that complexity was already there, just hidden by pretending barrier GVs were actual LDS.
DeltaFile
+474-0llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+81-74llvm/test/CodeGen/AMDGPU/s-barrier-signal-var-gep.ll
+72-61llvm/test/CodeGen/AMDGPU/s-barrier.ll
+59-43llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+52-14llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+32-32llvm/test/CodeGen/AMDGPU/amdgpu-lower-exec-sync.ll
+770-22448 files not shown
+1,234-57454 files

LLVM/project b5d93cdclang/docs AMDGPUSupport.md, clang/lib/AST Type.cpp

[clang][AMDGPU] Clean-up handling of named barrier type (#207687)

- Allow the type in struct/classes in very limited circumstances. The
goal is to enable creating trivial wrappers around the named barrier
variable, but ensure we can't get into situations where things would get
awkward. Currently this means we only allow the named barrier in
RecordDecls with exactly 1 field, that have no base class, and are not
inherited.
- Use a `amdgpu_barrier` LangAS for this type that currently maps to the
local AS. This allows easy switching to the barrier AS in a future
patch.
DeltaFile
+103-0clang/lib/Sema/SemaAMDGPU.cpp
+72-0clang/test/SemaHIP/amdgpu-barrier.hip
+71-0clang/test/SemaCXX/amdgpu-barrier.cpp
+28-16clang/test/CodeGenHIP/amdgpu-barrier-type.hip
+43-0clang/docs/AMDGPUSupport.md
+26-1clang/lib/AST/Type.cpp
+343-1717 files not shown
+469-3423 files

LLVM/project 4a206e7llvm/lib/Target/AMDGPU SIISelLowering.cpp AMDGPUMemoryUtils.h, llvm/test/CodeGen/AMDGPU addrspacecast-barrier.ll

Comments
DeltaFile
+4-3llvm/lib/Target/AMDGPU/SIDefines.h
+1-3llvm/test/CodeGen/AMDGPU/addrspacecast-barrier.ll
+1-1llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.h
+1-1llvm/lib/Target/AMDGPU/AMDGPUMemoryUtils.cpp
+1-1llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp
+9-106 files