[llvm] [RFC] IR: Define noalias.addrspace metadata (PR #102461)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 11 06:09:10 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());
----------------
arsenm wrote:
No, because the rule only is for the address space of the underlying object. You may be accessing it through an addrspacecasted pointer. If we wanted something like that, it would be more appropriate to put in the Lint analysis. Undefined behavior that transforms can happen to introduce generally should not be IR verifier errors
https://github.com/llvm/llvm-project/pull/102461
More information about the llvm-commits
mailing list