[PATCH] D147547: [AMDGPU] Add buffer intrinsics that take resources as pointers

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 09:44:07 PDT 2023


arsenm added a comment.

This should get a mention in the release notes



================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:1044
+// The versions of these intrinsics that take <4 x i32> arguments are deprecated
+// in favor of their .buffer.ptr variants that take ptr addrspace(8) arguments,
+// which allow for improved reasoning about memory accesses.
----------------
Comment should be updated to have ptr first 


================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:1245
+// gfx908 intrinsic
+def int_amdgcn_raw_ptr_buffer_atomic_fadd : AMDGPURawPtrBufferAtomic<llvm_anyfloat_ty>;
+
----------------
Should move this with the other gfx908 intrinsics


================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:1325
+// gfx908 intrinsic
+def int_amdgcn_struct_ptr_buffer_atomic_fadd : AMDGPUStructPtrBufferAtomic<llvm_anyfloat_ty>;
+
----------------
Same 


================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:1328
+// gfx90a intrinsics
+def int_amdgcn_struct_ptr_buffer_atomic_fmin : AMDGPUStructPtrBufferAtomic<llvm_anyfloat_ty>;
+def int_amdgcn_struct_ptr_buffer_atomic_fmax : AMDGPUStructPtrBufferAtomic<llvm_anyfloat_ty>;
----------------
Same 


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:159-160
+    return LLT::scalar(128);
+  const unsigned NumElems = Ty.getElementCount().getFixedValue();
+  return LLT::fixed_vector(NumElems, LLT::scalar(128));
+}
----------------
Can just pass in getElementCount to LLT::vector 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147547/new/

https://reviews.llvm.org/D147547



More information about the llvm-commits mailing list