[llvm] [AMDGPU] Make ds/global load intrinsics IntrArgMemOnly (PR #152792)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 13:49:13 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-amdgpu

Author: choikwa (choikwa)

<details>
<summary>Changes</summary>

This along with IntrReadMem means that the Intrinsic only reads memory through the given argument ptr and its derivatives. This allows passes like Inliner to attach alias.scope to the call instruction as it sees that no other memory is accessed.

Discovered via SWDEV-543741

---
Full diff: https://github.com/llvm/llvm-project/pull/152792.diff


1 Files Affected:

- (modified) llvm/include/llvm/IR/IntrinsicsAMDGPU.td (+1-1) 


``````````diff
diff --git a/llvm/include/llvm/IR/IntrinsicsAMDGPU.td b/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
index 90cfd8cedd51b..be6df257f668b 100644
--- a/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
+++ b/llvm/include/llvm/IR/IntrinsicsAMDGPU.td
@@ -3087,7 +3087,7 @@ class AMDGPULoadIntrinsic<LLVMType ptr_ty>:
   Intrinsic<
     [llvm_any_ty],
     [ptr_ty],
-    [IntrReadMem, IntrWillReturn, IntrConvergent, NoCapture<ArgIndex<0>>, IntrNoCallback, IntrNoFree],
+    [IntrReadMem, IntrArgMemOnly, IntrWillReturn, IntrConvergent, NoCapture<ArgIndex<0>>, IntrNoCallback, IntrNoFree],
     "",
     [SDNPMemOperand]
   >;

``````````

</details>


https://github.com/llvm/llvm-project/pull/152792


More information about the llvm-commits mailing list