[llvm] AtomicExpand: Fix creating invalid ptrmask for fat pointers (PR #94955)

Brian Favela via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 11 08:29:13 PDT 2024


================
@@ -1262,6 +1262,110 @@ define bfloat @test_atomicrmw_xchg_bf16_global_agent_align4(ptr addrspace(1) %pt
   ret bfloat %res
 }
 
+define i16 @test_atomicrmw_xchg_i16_buffer_fat_agent(ptr addrspace(7) %ptr, i16 %value) {
+; CHECK-LABEL: @test_atomicrmw_xchg_i16_buffer_fat_agent(
+; CHECK-NEXT:    [[ALIGNEDADDR:%.*]] = call ptr addrspace(7) @llvm.ptrmask.p7.i32(ptr addrspace(7) [[PTR:%.*]], i32 -4)
----------------
bfavela wrote:

AMD only supports unsigned offsets (unless you count those weird SRC2 LDS instructions), but they're also never larger than 32 bits.

Speaking of LDS, does any of this change for those instructions? IIUC, the AtomicExpansion works for both.

https://github.com/llvm/llvm-project/pull/94955


More information about the llvm-commits mailing list