[PATCH] D99719: [SLP] Better estimate cost of no-op extracts on target vectors.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 1 13:28:19 PDT 2021
ABataev added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3456
+ ArrayRef<Value *> VL, FixedVectorType *VecTy, TargetTransformInfo &TTI) {
+ bool AllConsecutive = true;
+ unsigned NumOfParts = TTI.getNumberOfParts(VecTy);
----------------
Move this after `if`
================
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);
----------------
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`
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