================
@@ -408,19 +396,34 @@ static void createNewAliasScopesFromNoAliasParameter(
// Call operations are included in this list since we do not know whether
// the callee accesses any memory besides the ones passed as its
// arguments.
- if (aliasesOtherKnownObject ||
- isa<LLVM::CallOp>(aliasInterface.getOperation()))
- return;
-
SmallVector<Attribute> aliasScopes;
- for (LLVM::SSACopyOp noAlias : noAliasParams)
- if (basedOnPointers.contains(noAlias))
- aliasScopes.push_back(pointerScopes[noAlias]);
+ if (!aliasesOtherKnownObject &&
+ !isa<LLVM::CallOp>(aliasInterface.getOperation()))
+ for (LLVM::SSACopyOp noAlias : noAliasParams)
+ if (basedOnPointers.contains(noAlias))
+ aliasScopes.push_back(pointerScopes[noAlias]);
- if (!aliasScopes.empty())
+ if (!aliasScopes.empty()) {
aliasInterface.setAliasScopes(
concatArrayAttr(aliasInterface.getAliasScopesOrNull(),
ArrayAttr::get(call->getContext(), aliasScopes)));
+ return;
+ }
+
+ // Add all noalias parameter scopes to the noalias scope list that we are
+ // not based on.
----------------
gysit wrote:
This path is the taken for operations that for example are based on an
underlying alloca or another memory object that cannot alias with the noalias
pointers?
If I am correct with my assumptions it would be could to encode this in a
comment?
https://github.com/llvm/llvm-project/pull/218773
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits