[llvm] [RFC] IR: Define noalias.addrspace metadata (PR #102461)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 10 09:59:56 PDT 2024


================
@@ -5180,6 +5206,13 @@ void Verifier::visitInstruction(Instruction &I) {
     visitRangeMetadata(I, Range, I.getType());
   }
 
+  if (MDNode *Range = I.getMetadata(LLVMContext::MD_noalias_addrspace)) {
+    Check(isa<LoadInst>(I) || isa<StoreInst>(I) || isa<AtomicRMWInst>(I) ||
+              isa<AtomicCmpXchgInst>(I) || isa<CallInst>(I),
+          "noalias.addrspace are only for memory operations!", &I);
+    visitNoaliasAddrspaceMetadata(I, Range, I.getType());
----------------
jurahul wrote:

Should we also add a check to the effect that if there is an operand in address space 'n', 'n' cannot be listed in the noalias.addrspace metadata for that instruction? 

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


More information about the llvm-commits mailing list