[PATCH] D57779: [SLP] Add support for throttling.

Dinar Temirbulatov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 09:24:34 PDT 2019


dtemirbulatov marked an inline comment as done.
dtemirbulatov added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2683
+      // values for canceled elements use.
+      if (InternalTreeUses.find(EU.Scalar) != InternalTreeUses.end())
+        for (ExternalUser &IU : InternalTreeUses[EU.Scalar])
----------------
dtemirbulatov wrote:
> dtemirbulatov wrote:
> > vporpo wrote:
> > > As far as I understand, you are calculating the additional cost for the EU.Scalars that are no longer vectorized (because of reduceTree()).
> > > So you are getting all its in-tree uses and you are calculating the extract operation cost from for the data transfer from EU.Scalar->vector use.
> > > 1. Isn't this an 'insert' operation and not an 'extract' ?
> > > 2. Isn't this just the gather cost that has already been considered in line 2756 ?
> > > 3. Even if you have multiple in-tree vectorized uses, we should only count the gather cost once, as the vector can then be reused for the rest of the uses with no extra cost.
> > Consider this example :
> > We considering to vectorize full tree height:
> > ....
> > a0 = x*a;
> > a1 = x*b;
> > a2 = x+c;
> > a3 = x+d;
> > ....
> > Then, later we decided to remove "a2", "a3" out of proposed to vectorized operations. And "x" variable is not available in a scalar form and in order to obtain "x" value we should extract "x" to be used in a scalar form. And while extracting "x" we should calculate the cost for such operation. It might be not profitable to vectorize such tree cut if we have to produce such an extract operation.
> > And for 2756 I have another example:
> > a0 = x*a;
> > a1 = x*b;
> > a2 = a0+c;
> > a3 = a1+d;
> > suppose that we would like to start vectorizaton from "a2", "a3" and "a0" and "a1" should be in scalar form we have calculated "c" and "d" as a gather operations, but since we are interrupting full-tree we have to consider calculating gather cost for "a0", "a1" because full intruppted full vectorization chain and "a0", "a1" are scalars now.
> in the first example, "x" is only available in a vectorized form only, internal vectorized tree use. So changing the example:
> x = ....
> a0 = x*a;
> a1 = x*b;
> a2 = x+c;
> a3 = x+d;
oh, I think, I incorrectly calculate gather cost for the second example at 2756, instead of calculating gather costs for a1, a0, I did the calculation for a2 and a3.


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

https://reviews.llvm.org/D57779





More information about the llvm-commits mailing list