[PATCH] D63067: [Attributor] NoAlias on return values.
Johannes Doerfert via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 9 20:24:05 PDT 2019
jdoerfert added inline comments.
================
Comment at: llvm/include/llvm/Transforms/IPO/Attributor.h:657
+
+ /// Return true if we know that underlying value does not alias.
+ virtual bool isKnownNoAlias() const = 0;
----------------
"does not alias." is confusing, maybe phrase it `is "noalias"`.
================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:364
+ return true;
+}
+
----------------
Use the `AAReturnedValuesImpl` instead of an explicit traversal. The `AAReturnedValuesImpl` knows what is returned and through which return instructions.
================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:371
+ if (F.returnDoesNotAlias())
+ return ChangeStatus::UNCHANGED;
+
----------------
Move this check in the `initialize` method.
================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:380
+ if (!F.hasExactDefinition() || !F.getReturnType()->isPointerTy() ||
+ !isFunctionMallocLike(F)) {
+ indicatePessimisticFixpoint();
----------------
This is not what we want to check. Look at the returned values and the locations where they are returned.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63067/new/
https://reviews.llvm.org/D63067
More information about the llvm-commits
mailing list