[PATCH] llvm.noalias - BasicAA should look through them too

Daniel Berlin dberlin at dberlin.org
Tue May 12 13:04:03 PDT 2015


================
Comment at: include/llvm/IR/Value.h:404
@@ -405,1 +403,3 @@
+  const Value *stripPointerCasts(bool LookThroughNoAlias = false) const {
+    return const_cast<Value*>(this)->stripPointerCasts(LookThroughNoAlias);
   }
----------------
hfinkel wrote:
> dberlin wrote:
> > So, is there actually a place you plan on not passing true here, or are you just trying to keep existing logic where you haven't explicitly modified it?
> > 
> > 
> > (Because i am having a bit of trouble seeing where you would want to pass false.  At the point you are stripping, why is noalias more magical to not strip than anything else that can appear here?)
> > 
> In some sense both, but I also wanted to keep the default not to strip them.
> 
> At least in theory, looking through casts and stripping llvm.noalias calls could lead to rewriting the pointer in terms of some underlying object (thus removing the aliasing information) -- SROA might do this for example -- and so I thought it would be easier to vet specific uses that we know won't do this.
> 
> Generically, I thought that "I added restrict and my code slowed down" will be easier to correct than "I added restrict and my code did not speed up as it should have".
> 
> We could certainly change the default (and thus remove the need for several of the patches in this series ;) ). I don't have a strong opinion.
> 
After thinking about this a lot, i'm strongly of the opinion we should just change the default. I think anything else is likely to create a mess :)

In fact, i'd go further, and say this shouldn't be a parameter at all. If someone wants a function that stops at noalias, they should write a new strip function. I don't think noalias is special enough, and can't think of a real use case, for wanting to stop there.

http://reviews.llvm.org/D9383

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list