[PATCH] D9804: Optimize scattered vector insert/extract pattern

Lawrence Hu via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 18:07:24 PDT 2015


hulx2000 added a comment.

In http://reviews.llvm.org/D9804#253856, @hfinkel wrote:

> In http://reviews.llvm.org/D9804#253832, @hulx2000 wrote:
>
> > Just saw comments from Hal and Nadav.
> >
> > For Hal's comments:
> >
> > 1. If the original ext is used more than once, then the original ext can't be deleted after my transformation, so it may not gain anything, that's why I check hasOneUse() on it.
>
>
> No, you'd replace them all with the corresponding extract. What am I missing?


If any of the original ext is used more than once, then it can't be deleted even though I will insert a vector ext instruction later, that may make this transformation not beneficial, of course a cost model would be better, but I didn't do it because the performance gain of this is not big, adding a complicate cost mode may not justify it.

> 

> 

> > 2. I agree, this transformation is designed for AArch64, so I could make it AArch64 specific.

> 

> > 

> 

> >   For Navav's comment "We are already doing these kind of optimizations in SelectionDAG. The SLPVectorizer is not the right place for this kind of transformation", do you mean I shouldn't do this (my) transformation in SLPVectorizer?  At least for our case, SelectionDAG is unable to catch it, and it caused a performance loss.

> 

> 

> Why is it not able to catch it? We need to understand that before we move forward with adding handling in the SLP vectorizer for this.


I will have to investigate that, didn't know SelectionDAG can handle this until now.


Repository:
  rL LLVM

http://reviews.llvm.org/D9804





More information about the llvm-commits mailing list