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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 08:02:41 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)
----------------
arsenm wrote:

Unsigned offsets are so problematic. I guess we could interpret this as a mask on the base address instead? But for that, we would want this to be the 64/48-bit mask and not the 32-bit indexing type 

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


More information about the llvm-commits mailing list