[PATCH] D82227: SLP: honor requested max vector size merging PHIs

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 21 11:07:56 PDT 2020


ABataev added a comment.

In D82227#2105769 <https://reviews.llvm.org/D82227#2105769>, @rampitec wrote:

> In D82227#2105650 <https://reviews.llvm.org/D82227#2105650>, @ABataev wrote:
>
> > In D82227#2105554 <https://reviews.llvm.org/D82227#2105554>, @rampitec wrote:
> >
> > > In D82227#2105469 <https://reviews.llvm.org/D82227#2105469>, @ABataev wrote:
> > >
> > > > Why it is required?
> > >
> > >
> > > The whole pass only creates vectors up to the size of a vector register provided by a target, this is simply an omission in this place not to check it.
> > >
> > > On practice the testcase is reduced from a real app where it has created two <32 x float> vectors and RA run out of registers. Both have to be alive at the same loop and we did not have sufficient number of registers.
> >
> >
> > Actually, that was the goal in some cases, to create the vectors of the maximum possible length so, later they could be split into several smaller vectors. I addume, this chanhe may increase compile time on the regular targets, where we can create large vectors without problems.
> >  I think, you need to fix the cost of the vectorization of the large vectors for your target, so the SLP could consider it unprofitable to vectorize large vectors.
>
>
> Isn't it inconsistent to use one width for arithmetic and another for phis? In particular I am getting more instructions after SLP for the actual app behind this test than without it because it forms <32 x float> phis and then lots of extractelement and insertelement to get to actual elements and perform arithmetic on it.


I don't think it is inconsistency. Actually, the larger vectors we are able to build, the better. It reduces compile time significantly, at least. And, most probably, leads to better vectorization.
Actually, it would be good if you could commit the test begore thr patch to see the difference in the transformation. But use the script to generate the checks, do not do it manyally.


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

https://reviews.llvm.org/D82227





More information about the llvm-commits mailing list