[PATCH] D100486: [COST]Improve cost model for shuffles in SLP.

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 01:21:08 PDT 2021


sdesmalen added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3620-3621
+            TargetTransformInfo::SK_PermuteSingleSrc;
+        if (ShuffleVectorInst::isReverseMask(NewMask))
+          SK = TargetTransformInfo::SK_Reverse;
+        CommonCost = TTI->getShuffleCost(SK, VecTy, NewMask);
----------------
ABataev wrote:
> RKSimon wrote:
> > sdesmalen wrote:
> > > Can the finding of a more specific ShuffleKind be done by getShuffleCost when a Mask is given?
> > > It seems a bit inconvenient to have to do that manually before calling this function.
> > I made a similar comment on D100495 - we could do with a generic 'ShuffleKind' decoder helper function (e.g. in Analysis\VectorUtils.h) that everybody can use.
> In this case, we need to update `getShuffleCost` function for all the targets to translate the mask. Is it ok if I'll do it in this patch?
There's already a few different changes in this patch (AArch64 cost-model, X86 cost-model and changes to the SLPVectorizer), so I think it makes more sense to do this in a separate patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100486



More information about the llvm-commits mailing list