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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 03:48:57 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/include/llvm/IR/IntrinsicsAMDGPU.td:1009-1010
+
+def int_amdgcn_flat_as_buffer_rsrc : AMDGPUPtrAsBufferRsrc<0>;
+def int_amdgcn_global_as_buffer_rsrc : AMDGPUPtrAsBufferRsrc<1>;
+
----------------
krzysz00 wrote:
> arsenm wrote:
> > There's no reason to have different intrinsics for different source address spaces. Just accept a type mangling operand for the input pointer 
> 1. Does "any pointer" work for different address spaces? The documentation's a bit fuzzy
> 2. If we're accepting arbitrary pointers, will we then need to, during legalization, reject pointer types that don't make sense (ex. LDS)?
1. Yes
2. Yes. Ideally we would have a target IR verifier for these sorts of things. In general we just get selection errors for weird things like this. If you just handle any 64-bit pointer I think it will work out that way without having to do anything special 


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