[PATCH] D99719: [SLP] Better estimate cost of no-op extracts on target vectors.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 1 13:40:05 PDT 2021


fhahn marked 2 inline comments as done.
fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3540-3543
+        if (*ShuffleKind == TargetTransformInfo::SK_PermuteSingleSrc)
+          Cost = computeExtractCostForPermuteSingleSrc(VL, VecTy, *TTI);
+        else
+          Cost = TTI->getShuffleCost(ShuffleKind.getValue(), VecTy, Mask);
----------------
ABataev wrote:
> Since you have a call for `TTI->getShuffleCost(ShuffleKind.getValue(), VecTy, Mask)` in `computeExtractCostForPermuteSingleSrc` maybe just check for shuffle kind in this function rathr than here? And go the conservatiave way if `*ShuffleKind != TargetTransformInfo::SK_PermuteSingleSrc`? In this case you would need to rename `computeExtractCostForPermuteSingleSrc` to something like `computeExtractCost`
Done, everything is now done in the function. Overall that should make the code simpler again, thanks.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99719



More information about the llvm-commits mailing list