[PATCH] D11311: Replace hardcoded threshold with an option when analyze read attributes

Xuetian Weng xweng at google.com
Thu Jul 23 10:01:42 PDT 2015


wengxt added a comment.

In http://reviews.llvm.org/D11311#208782, @nicholas wrote:

> Xuetian Weng wrote:
>
> > wengxt added a comment.
>
> > 
>
> > > Question one, what does this have to do with ld.global.nc? It looks like
>
> > 
>
> > >  you've got a load instruction (wrapped in an intrinsic) and it in turn
>
> > 
>
> > >  has many uses. The fact it's ld.global.nc doesn't seem to be relevant?
>
> > 
>
> > > 
>
> > 
>
> > > In theory, if you replaced the ld.global.nc with a LoadInst, would you
>
> > 
>
> > >  have the same problem? Or is there some other optimization that occurs
>
> > 
>
> > >  on those uses of a LoadInst that doesn't occur on the ld.global.nc?
>
> > 
>
> > 
>
> > In our case, we intend to transform LoadInst into ld.global.nc during Instruction
>
> >  selection, not the other direction. It's only safe to use ld.global.nc for LoadInst
>
> >  if the pointer being accessed is readonly (and noalias, which is irreverent to this
>
> >  patch).
>
>
> I realize that, but my question stands. Is there an optimization that 
>  should be happening to these ld.global.nc before we get here?


My commit message might be confusing. I don't think this change has anything to do with ld.global.nc. The LoadInst to ld.global.nc optimization is just one of the examples which can benefit from this change. And we happened to notice that when we are working on our cuda compiler.


http://reviews.llvm.org/D11311







More information about the llvm-commits mailing list