[PATCH] D73428: [Attributor] Improve `noalias` deduction based on memory information

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 20 17:29:18 PST 2020


baziotis added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:2772-2774
+    // If the definition is not `noalias` we need to check globals in addition
+    // to arguments. If the definition is `noalias` we cannot alias globals to
+    // begin with.
----------------
jdoerfert wrote:
> baziotis wrote:
> > jdoerfert wrote:
> > > baziotis wrote:
> > > > Why do we know that?
> > > If we have already `noalias` (or an alloca) we know we do not alias any access in the scope not derived from this pointer. Since globals cannot be derived from a `noalias` pointer (in a way that would be problematic here) or in any way from an alloca, we know the global does not alias the pointer.
> > Thanks for the explanation! The parts "a scope is derived from a pointer" (e.g. in the scope not derived from this pointer) are still unclear to me. What do I miss? Is there a specific part of code / doc I can read?
> I think the actually relevant documentation is https://en.cppreference.com/w/c/language/restrict
Thanks, I hadn't seen that comment.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D73428/new/

https://reviews.llvm.org/D73428





More information about the llvm-commits mailing list