[llvm] [AMDGPU][Verifier] Check address space of `alloca` instruction (PR #135820)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 23 05:59:09 PDT 2025


================
@@ -4392,6 +4392,12 @@ void Verifier::visitAllocaInst(AllocaInst &AI) {
     verifySwiftErrorValue(&AI);
   }
 
+  if (TT.isAMDGPU()) {
+    Check(AI.getAddressSpace() == DL.getAllocaAddrSpace() ||
+              AI.getAddressSpace() == 0,
----------------
shiltian wrote:

We can't include `AMDGPU.h` where `AMDGPUAS` is defined here.

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


More information about the llvm-commits mailing list