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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 07:38:14 PDT 2023


arsenm added inline comments.


================
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>],
----------------
krzysz00 wrote:
> arsenm wrote:
> > make_buffer_rsrc? as makes it sound like a regular cast?
> I'm thinking of it as an `addrspacecast` that takes arguments, hence the naming, but I'm not too tied to the name.
I think "make" or "create" would be better 


================
Comment at: llvm/test/CodeGen/AMDGPU/llvm.amdgcn.as.buffer.rsrc.ll:2
+; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
+; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs -stop-after=amdgpu-isel < %s | FileCheck %s
+
----------------
Why split the dag and globalisel versions of the tests? The dag version should also use an explicit -global-isel=0 run line 


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