================
@@ -176,6 +204,37 @@ bool ScopedNoAliasAAResult::mayAliasInScopes(const MDNode
*Scopes,
return true;
}
+bool ScopedNoAliasAAResult::mayAliasInDisjointDomains(const MDNode *Scopes1,
+ const MDNode *Scopes2) {
+ if (!Scopes1 || !Scopes2)
+ return true;
+
+ // Collect the domains with disjoint scopes that the first access is in.
+ SmallPtrSet<const MDNode *, 16> Domains;
+ for (const MDOperand &MDOp : Scopes1->operands())
+ if (const MDNode *MD = dyn_cast<MDNode>(MDOp))
+ if (const MDNode *Domain = AliasScopeNode(MD).getDomain())
+ if (AliasScopeDomainNode(Domain).hasDisjointScopes())
+ Domains.insert(Domain);
+
+ // Each access is implicitly noalias with every scope of such a domain it is
+ // not itself in, so the accesses don't alias if, for some domain, they have
+ // no scope in common.
----------------
brunodf-gf wrote:
More precise: "the accesses don't alias if, for some domain, both accesses use
one or more of its scopes, but they have none of its scopes in common"
(Note how you are formulating the noalias constraint that you are _actually_
implementing here.)
https://github.com/llvm/llvm-project/pull/218768
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits