LLVM/project db52992 — llvm/include/llvm/IR IRBuilder.h

Reapply [IRBuilder] Assert correct offset width for CreatePtrAdd (#239262)

Reapply #238806 without changes after fixing more CreatePtrAdd uses.

-----

Assert that the offset width matches the pointer index width. This is
supposed to become an IR well-formedness requirement when we switch to
ptradd, so we should start asserting it in the builder now.

Helpers like CreatePtrAddWith(Unsigned|Signed)Offset and
CreatePtrAddWith[SZ]ExtOrTrunc can be used to more conveniently create
ptradds with appropriately sized offsets.

Problematic uses of CreatePtrAdd were already adjusted in #238347.
DeltaFile
+4-2llvm/include/llvm/IR/IRBuilder.h
+4-21 files

LLVM/project f6f7322 — llvm/lib/Transforms/Instrumentation MemorySanitizer.cpp

[MemorySanitizer] Consistently use unsigned offsets (NFC) (#239193)

Helper functions for getting origin/shadow etc accepted a mix of int and
unsigned. I believe all of these offsets are non-negative, so use
unsigned everywhere to avoid confusion.
DeltaFile
+13-12llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+13-121 files

LLVM/project e0d0b97 — llvm/test/CodeGen/RISCV rvp-simd-32.ll rvp-simd-64.ll

[RISCV][P-ext] Remove line breaks from argument list of function definition in tests. NFC (#238881)

These line breaks cause the update_llc_test_checks.py script to put the
checks in the middle of the argument list.
DeltaFile
+23-44llvm/test/CodeGen/RISCV/rvp-simd-64.ll
+8-16llvm/test/CodeGen/RISCV/rvp-simd-32.ll
+31-602 files

LLVM/project 4c22a9f — mlir/include/mlir/Dialect/AMDGPU/IR AMDGPUDialectDecl.h, mlir/include/mlir/Dialect/Affine/IR AffineDialect.h

[mlir][ODS] Include headers required by generated dialect declarations and definitions (#239215)

Generated dialect declarations and definitions use C++ constructs that
are not declared by any header they include. They therefore relied on
the surrounding source file to include these headers first.

The dialect declarations now include the header declaring the dialect
base class, and the headers declaring `StringAttr` and `Operation` if
the dialect has discardable attributes. The dialect definitions include
`MLIRContext.h` if they load dependent dialects.

Similar to #236155 and #238735 but for the dialect generator.

Co-authored-by: Claude <noreply at anthropic.com>
DeltaFile
+40-0mlir/test/mlir-tblgen/cpp-includes-dialect.td
+20-0mlir/tools/mlir-tblgen/DialectGen.cpp
+0-3mlir/include/mlir/Dialect/LLVMIR/ROCDLDialectDecl.h
+0-2mlir/include/mlir/Dialect/Arith/IR/ArithDialect.h
+0-2mlir/include/mlir/Dialect/Affine/IR/AffineDialect.h
+0-2mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPUDialectDecl.h
+60-952 files not shown
+61-7658 files

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

[Bazel] Fixes d1ec07e (#239493)

This fixes d1ec07e0431412a667fecd5c2708f3606b6799a4 (#238966).

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

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 5c9aa46 — llvm/test/CodeGen/AMDGPU memintrinsic-unroll.ll amdgcn.bitcast.832bit.ll

[spr] update

Created using spr 2.0.0-beta.2
DeltaFile
+89,147-91,827llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+25,378-26,402llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.512bit.ll
+9,311-9,381llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.960bit.ll
+8,998-9,209llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.896bit.ll
+8,016-8,194llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.832bit.ll
+7,335-7,432llvm/test/CodeGen/AMDGPU/memintrinsic-unroll.ll
+148,185-152,44513,886 files not shown
+699,970-465,39813,892 files

LLVM/project 47d998a — llvm/lib/Target/LoongArch LoongArchRegisterInfo.cpp, llvm/test/CodeGen/LoongArch/lasx xvldrepl-frame-index.ll

[LoongArch] Fix misaligned frame-index offset for vldrepl.{h,w,d}

eliminateFrameIndex did not check that the final offset is a multiple of
the access size for [X]VLDREPL_{H,W,D}, so a byte-aligned stack object
could produce an unencodable immediate. Materialize the address in a
scratch register in that case, as is already done for [X]VSTELM_*.

Assisted-by: LLM
DeltaFile
+12-0llvm/lib/Target/LoongArch/LoongArchRegisterInfo.cpp
+6-3llvm/test/CodeGen/LoongArch/lsx/vldrepl-frame-index.ll
+6-3llvm/test/CodeGen/LoongArch/lasx/xvldrepl-frame-index.ll
+24-63 files

LLVM/project e641369 — llvm/test/CodeGen/LoongArch/lasx xvldrepl-frame-index.ll, llvm/test/CodeGen/LoongArch/lsx vldrepl-frame-index.ll

[LoongArch] Pre-commit tests for misaligned frame-index offset on vldrepl

Assisted-by: LLM
DeltaFile
+76-0llvm/test/CodeGen/LoongArch/lasx/xvldrepl-frame-index.ll
+76-0llvm/test/CodeGen/LoongArch/lsx/vldrepl-frame-index.ll
+152-02 files

LLVM/project fa98dee — llvm/lib/CodeGen/SelectionDAG TargetLowering.cpp, llvm/test/CodeGen/X86 tl-libcalls-module-flags.ll

[TargetLowering] Use DAG.getLibcalls() in expandMultipleResultFPLibCall (#239150)

`getLibcallLoweringInfo` and the helper `getLibcallImplCallingConv`
access the `Libcalls` from TargetLoweringBase, which is constructed
without the LLVM Module being available. This affects the libcalls
available through module flags like `long-double-type`. SelectionDAG
already consults the module flags, so missing it here can lead
inconsistencies in which libcalls are available.

Fixes: #239145
DeltaFile
+34-0llvm/test/CodeGen/X86/tl-libcalls-module-flags.ll
+3-2llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
+37-22 files

LLVM/project 8a8ab64 — offload/include device.h, offload/libompaccsupport device.cpp

[Offload][Omp] Decouple RecordReplay from PluginInterface (#236814)

After we broke the `GenericKernelyTy` dependence in the RecordReplay
(RR), most of it became independent from the `PluginInterface`.

This PR moves the RR logic from the `PluginInterface` to libomptarget
and changes RR to use OpenMP errors and liboffload for data transfers.
Still, the _VirtualAddress_ interfaces are not available through the
liboffload API so we use them through temporary helpers.

I purposely didn't move the RR source files from the plugin directory so
the changes in this PR would easier to review. The code will be
reorganized in a follow-up NFC PR.

It was verified by @kevinsala on NVIDIA and AMD gpus.

Assisted by Claude

---------

Co-authored-by: Kevin Sala <salapenades1 at llnl.gov>
DeltaFile
+92-18offload/libompaccsupport/device.cpp
+67-42offload/plugins-nextgen/common/src/RecordReplay.cpp
+0-37offload/plugins-nextgen/common/src/PluginInterface.cpp
+0-34offload/plugins-nextgen/common/include/PluginInterface.h
+11-11offload/plugins-nextgen/common/include/RecordReplay.h
+22-0offload/include/device.h
+192-1424 files not shown
+217-14910 files

LLVM/project 5c81f69 — llvm/include/llvm/Transforms/IPO Attributor.h, llvm/lib/Transforms/IPO Attributor.cpp

Attributor: Only check once if time trace scopes are recorded

Every initialization and update of an abstract attribute opened a
TimeTraceScope, which checks if the time profiler is enabled out of line.
Check it once per Attributor instead. NFC.

CTMark instructions:u with -attributor-enable=light changes by O3 -0.02%,
ThinLTO -0.03%. The attributor-light pass itself is 0.3-0.8% faster
(callgrind), and 0.3-1.9% faster with the other pending Attributor
compile-time changes applied.

Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
DeltaFile
+12-4llvm/include/llvm/Transforms/IPO/Attributor.h
+8-4llvm/lib/Transforms/IPO/Attributor.cpp
+20-82 files

LLVM/project c408850 — llvm/test/CodeGen/AArch64 arm64-dagcombiner-load-slicing.ll scalarized-store.ll

[AArch64] Regnerate arm64-dagcombiner-load-slicing.ll and add expended store tests. NFC (#239509)
DeltaFile
+900-0llvm/test/CodeGen/AArch64/scalarized-store.ll
+33-21llvm/test/CodeGen/AArch64/arm64-dagcombiner-load-slicing.ll
+933-212 files

LLVM/project eaaa209 — llvm/lib/Target/AMDGPU AMDGPURegBankLegalizeRules.cpp, llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-stackrestore.mir

[AMDGPU][GISel] Add RegBankLegalize rule for G_STACKRESTORE
DeltaFile
+21-4llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-stackrestore.mir
+2-0llvm/lib/Target/AMDGPU/AMDGPURegBankLegalizeRules.cpp
+23-42 files

LLVM/project 456b470 — llvm/test/CodeGen/AMDGPU/GlobalISel regbankselect-stackrestore.mir

pre-commit failing test cases
DeltaFile
+41-0llvm/test/CodeGen/AMDGPU/GlobalISel/regbankselect-stackrestore.mir
+41-01 files

LLVM/project 2c87de2 — clang/lib/CIR/Dialect/Transforms CIRABIClassifier.cpp, clang/lib/CIR/Dialect/Transforms/TargetLowering CIRABIRewriteContext.h CIRABIRewriteContext.cpp

[CIR][AMDGPU] Lower Indirect arguments and sret returns in addrspace(5)
DeltaFile
+62-34clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
+93-0clang/test/CIR/Transforms/abi-lowering/amdgpu-indirect.cir
+0-22clang/test/CIR/Transforms/abi-lowering/amdgpu-indirect-nyi.cir
+6-5clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.h
+0-3clang/lib/CIR/Dialect/Transforms/CIRABIClassifier.cpp
+161-645 files

LLVM/project 7e4250c — clang/test/OpenMP interchange_codegen.cpp, libcxx/test/std/language.support/support.limits/support.limits.general version.version.compile.pass.cpp

Merge branch 'main' into users/zero9178/ods-dialect-includes
DeltaFile
+8,752-1,285llvm/test/CodeGen/WebAssembly/memory-interleave.ll
+3,550-3,691llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+984-980llvm/test/CodeGen/Thumb2/mve-fptosi-sat-vector.ll
+818-816llvm/test/CodeGen/ARM/vector-lrint.ll
+1,576-10libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
+764-684clang/test/OpenMP/interchange_codegen.cpp
+16,444-7,4661,517 files not shown
+66,422-32,9671,523 files

LLVM/project 58ddb5c — llvm/lib/Target/AArch64 AArch64ISelLowering.cpp, llvm/test/CodeGen/AArch64 concat_vector-truncate-combine.ll concat_vector-truncate-combine2.ll

[DAG][AArch64] Use NVCAST instead of BITCAST in (concat_vectors (trunc), (trunc)) (#238633)

Fix issue: https://github.com/llvm/llvm-project/issues/238632
DeltaFile
+53-0llvm/test/CodeGen/AArch64/concat_vector-truncate-combine2.ll
+0-26llvm/test/CodeGen/AArch64/concat_vector-truncate-combine.ll
+5-5llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+58-313 files

LLVM/project 713c979 — mlir/lib/Dialect/NVGPU/Transforms OptimizeSharedMemory.cpp, mlir/test/Dialect/NVGPU optimize-shared-memory.mlir

[mlir][nvgpu] Don't swizzle shared memory rows that aren't a power of 2 (#237179)

`nvgpu-optimize-shared-memory` miscompiles memrefs whose rows aren't a
power
of 2 long. The swizzle XORs the index of each 16-byte vector in a row
with low
bits of the row index. When a row holds a power of 2 number of vectors,
the
result is always an index in the same row, so the swizzle only reorders
each
row. Otherwise, the result can be past the end of the row: the access
then
lands in the next row and overwrites one of its vectors, or past the end
of
the buffer for the last rows.

Skip such memrefs and leave their accesses unswizzled.

Assisted-by: Claude
DeltaFile
+30-0mlir/test/Dialect/NVGPU/optimize-shared-memory.mlir
+6-0mlir/lib/Dialect/NVGPU/Transforms/OptimizeSharedMemory.cpp
+36-02 files

LLVM/project 6cb57a4 — orc-rt/include/orc-rt/bedrock/sps LookupInJITDylibSPS.h, orc-rt/lib/bedrock CMakeLists.txt

[orc-rt] Add sps::lookupInJITDylib controller-call wrapper (#239494)

sps::lookupInJITDylib asks the controller to look up a SymbolLookupSet
in the JITDylib identified by the given key address, calling the
controller handler identified by the new
orc_rt_tag_sps_lookupSymbolsInJITDylib tag.

Clients index the result by lookup-set position, so a controller result
whose length doesn't match the lookup set is reported as an error rather
than passed on.

This commit also adds DirectControllerAccess to the unit-test utilities:
a ControllerAccess that routes executor-to-controller calls to handlers
registered by tag and runs them on the calling thread. The new tests use
it to check that arguments and results survive the round trip; lookup
semantics belong to the controller and aren't tested here.
DeltaFile
+158-0orc-rt/test/unit/bedrock/sps/LookupInJITDylibSPSTest.cpp
+79-0orc-rt/test/unit/BedrockTestUtils.h
+47-0orc-rt/lib/bedrock/sps/LookupInJITDylibSPS.cpp
+38-0orc-rt/include/orc-rt/bedrock/sps/LookupInJITDylibSPS.h
+1-0orc-rt/test/unit/CMakeLists.txt
+1-0orc-rt/lib/bedrock/CMakeLists.txt
+324-01 files not shown
+325-07 files

LLVM/project 571ff30 — flang/include/flang/Support Fortran-features.h, flang/lib/Semantics check-omp-structure.cpp

[Flang][OpenMP] Warn about SAVE variables in MAP w/o ALWAYS modifier (#209134)

When mapping a variable that has the SAVE attribute, a MAP clause is not
effective unless it has the ALWAYS modifier. The reason is that the
reference count of the variable on the device is infinite and thus no
data transfer occur when ALWAYS is not present. This is a common source
of errors and the compiler should warn about this behavior.

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot at users.noreply.github.com>
DeltaFile
+188-0flang/test/Semantics/OpenMP/map-save-attribute.f90
+67-0flang/lib/Semantics/check-omp-structure.cpp
+1-1flang/include/flang/Support/Fortran-features.h
+1-0flang/lib/Support/Fortran-features.cpp
+257-14 files

LLVM/project 6f85e58 — lldb/source/Plugins/Process/Utility RegisterContextDarwin_arm.cpp, lldb/source/Plugins/Register/Darwin RegisterContextDarwin_arm.cpp

rebase

Created using spr 2.0.0-beta.2
DeltaFile
+8,752-1,285llvm/test/CodeGen/WebAssembly/memory-interleave.ll
+3,550-3,691llvm/test/CodeGen/AMDGPU/amdgcn.bitcast.1024bit.ll
+3,186-0llvm/test/CodeGen/AMDGPU/amdgcn-av-scopes.ll
+984-980llvm/test/CodeGen/Thumb2/mve-fptosi-sat-vector.ll
+0-1,738lldb/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+1,738-0lldb/source/Plugins/Register/Darwin/RegisterContextDarwin_arm.cpp
+18,210-7,6945,098 files not shown
+141,540-74,9645,104 files

LLVM/project 46ca555 — clang/lib/CIR/Dialect/Transforms/TargetLowering CIRABIRewriteContext.cpp, clang/test/CIR/Transforms/abi-lowering amdgpu-sret-nontrivial.cir

[CIR][AMDGPU] Look through address_space views of __retval in insertSRetStores (#239151)

Summary:

- On AMDGPU, a non-trivial record is returned through a default address
space `sret` pointer, but `CIRGen` puts `__retval` in addrspace(5) and
uses it through an `address_space` cast.
- `insertSRetStores` replaced the alloca with the sret pointer even
though the types differ. The cast then became an identity cast:
`%0` = cir.cast address_space %arg0 : !cir.ptr<!rec_NT> ->
!cir.ptr<!rec_NT>`
- When the types differ, replace the alloca's `address_space` views with
the sret pointer instead, and erase the alloca once its return loads are
gone.
- Test: `amdgpu-sret-nontrivial.cir`

Relates to: https://github.com/llvm/llvm-project/issues/220471

Assisted by : claude opus 5.5
DeltaFile
+54-0clang/test/CIR/Transforms/abi-lowering/amdgpu-sret-nontrivial.cir
+27-4clang/lib/CIR/Dialect/Transforms/TargetLowering/CIRABIRewriteContext.cpp
+81-42 files

LLVM/project d1ec07e — mlir/lib/Conversion/IndexToLLVM CMakeLists.txt IndexToLLVM.cpp, mlir/test/Conversion/IndexToLLVM index-to-llvm.mlir

[mlir][index] Derive index bitwidth from the data layout (#238966)
DeltaFile
+32-3mlir/test/Conversion/IndexToLLVM/index-to-llvm.mlir
+5-2mlir/lib/Conversion/IndexToLLVM/IndexToLLVM.cpp
+2-0mlir/lib/Conversion/IndexToLLVM/CMakeLists.txt
+39-53 files

LLVM/project 242233a — clang/test/CXX/drs cwg17xx.cpp, clang/www cxx_dr_status.html

[clang] Update C++ DR status page (#239482)

This is a follow-up for #237113 that contains missing updates for the
C++ DR status page and fixes a typo in an issue status comment (it
didn't make it to the status page last time, so no one noticed).
DeltaFile
+3-3clang/www/cxx_dr_status.html
+1-1clang/test/CXX/drs/cwg17xx.cpp
+4-42 files

LLVM/project 4f2748f — flang/lib/Optimizer/Analysis AliasAnalysis.cpp, flang/test/Analysis/AliasAnalysis modref-stack-and-unreachable.fir

[flang] Treat stack save/restore and fir.unreachable as not accessing memory (#239240)

These operations do not declare memory effects, so the alias analysis
assumed they may modify and reference any memory. They do not access
memory: answer NoModRef for them.
DeltaFile
+22-0flang/test/Analysis/AliasAnalysis/modref-stack-and-unreachable.fir
+10-0flang/lib/Optimizer/Analysis/AliasAnalysis.cpp
+32-02 files

LLVM/project 32d01ab — compiler-rt/lib/sanitizer_common sanitizer_platform_interceptors.h, compiler-rt/lib/tsan/rtl tsan_rtl_report.cpp tsan_interceptors_posix.cpp

[tsan] Intercept C11 thrd_create, thrd_join and thrd_detach on glibc (#238768)

glibc implements thrd_create, thrd_join and thrd_detach by calling its
internal pthread functions directly, so the pthread interceptors never
see C11 threads. A thread created with thrd_create has no ThreadState
and crashes on its first instrumented access or intercepted call
(#199585).

Intercept them, forwarding to the real functions. thrd_create starts the
thread in a C11 trampoline, __tsan_c11_thread_start_func, and reuses the
pthread_create bookkeeping; reports strip the trampoline from thread
stacks, as they do __tsan_thread_start_func. thrd_exit needs no
interceptor.

Only glibc needs this: FreeBSD, NetBSD and Android implement the C11
functions with the public pthread functions, which are already
intercepted. The new SANITIZER_INTERCEPT_C11_THREADS will also be used
by the other sanitizers that need these interceptors.

Assisted-by: Claude
DeltaFile
+43-0compiler-rt/lib/tsan/rtl/tsan_interceptors_posix.cpp
+40-0compiler-rt/test/tsan/thrd_race.c
+4-2compiler-rt/lib/tsan/rtl/tsan_rtl_report.cpp
+6-0compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
+1-1compiler-rt/test/sanitizer_common/TestCases/Posix/c11_thrd.c
+94-35 files

LLVM/project 0616444 — llvm/include/llvm/Transforms/Scalar DeadStoreElimination.h

[DSE] Drop outdated header docs (NFC) (#239143)

Literally every sentence in the current documentation is wrong. Drop them, it's
easy to find the implementation file with more accurate documentation.
DeltaFile
+1-11llvm/include/llvm/Transforms/Scalar/DeadStoreElimination.h
+1-111 files

LLVM/project fe0f7e5 — clang/lib/AST/ByteCode InterpState.cpp InterpState.h

[clang][bytecode] Split up `InterpState::dealllocate()` (#239185)

Split it into the common case of "block has no pointers to it" and
"block that _does_".
DeltaFile
+17-1clang/lib/AST/ByteCode/InterpState.h
+3-10clang/lib/AST/ByteCode/InterpState.cpp
+20-112 files

LLVM/project 6465db5 — llvm/lib/Target/AMDGPU AMDGPURegBankCombiner.cpp AMDGPUCombine.td, llvm/test/CodeGen/AMDGPU/GlobalISel fmin3-fmax3-combine.ll

[AMDGPU][GlobalISel] Form min3/max3 from minimumnum and maximumnum (#225795)

Map these to FMAX3/FMIN3 as SelectionDAG does, not the NaN-propagating
FMAXIMUM3/FMINIMUM3
DeltaFile
+208-0llvm/test/CodeGen/AMDGPU/GlobalISel/fmin3-fmax3-combine.ll
+11-4llvm/lib/Target/AMDGPU/AMDGPUCombine.td
+2-2llvm/lib/Target/AMDGPU/AMDGPURegBankCombiner.cpp
+221-63 files

LLVM/project 252a1f4 — llvm/lib/Target/AMDGPU AMDGPUHWEvents.cpp, llvm/test/CodeGen/AMDGPU waitcnt-global-inv-xcnt.mir

[AMDGPU] Track GLOBAL_INV/WB/WBINV with xcnt on gfx12.5 (#236045)

Currently, GLOBAL_INV, GLOBAL_WB and GLOBAL_WBINV take the early FLAT
return in getEventsForImpl and never get VMEM_GROUP, so with XNACK an
$exec def after them gets no s_wait_xcnt. This patch adds VMEM_GROUP to
all three when the subtarget has xcnt and XNACK is enabled.

As a result, an s_load followed by one of these ops now counts as an
SMEM-to-VMEM switch, so the s_load address wait is dropped. An earlier
global_load address wait becomes s_wait_xcnt 1 instead of s_wait_xcnt 0.
DeltaFile
+142-0llvm/test/CodeGen/AMDGPU/waitcnt-global-inv-xcnt.mir
+6-3llvm/lib/Target/AMDGPU/AMDGPUHWEvents.cpp
+148-32 files