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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 12:02:08 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:5217-5218
+  // an abundance of caution.
+  case Intrinsic::amdgcn_flat_as_buffer_rsrc:
+  case Intrinsic::amdgcn_global_as_buffer_rsrc:
     return true;
----------------
This handling needs a test (I'm assuming that was the intent of ptr-buffer-alias-scheduling.ll, but I think we also need a pure IR one that doesn't depend on codegen)


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPULegalizerInfo.cpp:4423-4424
+    } else {
+      Register ExtStride = MRI.createGenericVirtualRegister(S32);
+      B.buildAnyExt(ExtStride, Stride);
+      Register ShiftConst = MRI.createGenericVirtualRegister(S32);
----------------
You can combine all of these createGenericVirtualRegister calls like:

```
auto ExtStride = B.buildAnyExt(S32, Stride)

```


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