================
@@ -1156,6 +1156,20 @@ void llvm::cloneNoAliasScopes(ArrayRef<MDNode *> 
NoAliasDeclScopes,
                               StringRef Ext, LLVMContext &Context) {
   MDBuilder MDB(Context);
 
+  // A cloned scope has to go into a clone of its domain if that domain has
+  // disjoint scopes: the copies of a duplicated access are in the same memory
+  // region, so they must not become implicitly noalias with each other.
+  DenseMap<const MDNode *, MDNode *> ClonedDomains;
+  auto GetClonedDomain = [&](const MDNode *Domain) {
+    if (!Domain || !AliasScopeDomainNode(Domain).hasDisjointScopes())
----------------
brunodf-gf wrote:

While `AliasScopeNode::getDomain` is written as if it could return nullptr, the 
Verifier guarantees that a scope has a domain? So I find this `!Domain ||` part 
distracting.

https://github.com/llvm/llvm-project/pull/218768
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to