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

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 16:17:38 PST 2020


hfinkel added a comment.

In D73428#1879059 <https://reviews.llvm.org/D73428#1879059>, @jdoerfert wrote:

> In D73428#1878746 <https://reviews.llvm.org/D73428#1878746>, @uenoku wrote:
>
> > And I have a question.
> >
> >   define i32 @f1(i32* %p, i32* %q){
> >   entry:
> >     %0 = load i32, i32* %q
> >     %1 = load i32, i32* %p
> >     %add = add nsw i32 %1, %0
> >     ret i32 %add
> >   }
> >  
> >   define i32 @f2(i32* nocapture readonly %p) {
> >   entry:
> >     %call = tail call i32 @f1(i32* %p, i32* %p)
> >     ret i32 %call
> >   }
> >
> >
> > In this case, `%call = tail call i32 @f1(i32* noalias %p, i32* noalias %p)` is deduced because they have only "read-read" dependencies.
> >  I agree that this is a sound deduction since there is no write. (I know Rust compiler is doing similar things)
> >
> > However, looking back to the definition of `noalias` in LangRef, I think this annotation violates the definition. Is it allowed conventionally?
>
>
> If this would violate the LangRef we would have a problem. I don't think it does but I think we need to make that explicit. I'll talk to @hfinkel and come back with lang ref patch or a revised version of this ;)


I think that this is probably a good idea, but I think that we need a short RFC on this. We should have some visibility on this issue before we update the LangRef in this regard.


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