[PATCH] D148957: [AMDGPU] Add intrinsic for converting global pointers to resources

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 26 11:04:46 PDT 2023


arsenm added a comment.

What should happen if I do something like:

    %alloca = ...
    %cast = addrspacecast ptr addrspace(5) %alloca to ptr
    %buffer = call ptr addrspace(8) @llvm.amdgcn.as.buffer.rsrc.p0(ptr %cast ...)
  
  Now you can do evil things like access other lanes private stack items. Should we define this to poison or something?



================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:998
 
+// Use i8 type because we can't pull the element type out of an anyptr.
+def int_amdgcn_as_buffer_rsrc : DefaultAttrsIntrinsic <
----------------
Drop this comment, the i8 reference is vestigial 


================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:999
+// Use i8 type because we can't pull the element type out of an anyptr.
+def int_amdgcn_as_buffer_rsrc : DefaultAttrsIntrinsic <
+  [AMDGPUBufferRsrcTy<llvm_i8_ty>],
----------------
make_buffer_rsrc? as makes it sound like a regular cast?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148957



More information about the llvm-commits mailing list