[PATCH] D75689: [VectorCombine] fold extract-extract-op with different extraction indexes
Roman Lebedev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 03:21:47 PST 2020
lebedev.ri added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:119
+ return true;
+
+ // If we are extracting from 2 different indexes, then 1 operand must be
----------------
So essentially we are assuming that this is the optimal cost model.
Can we assert that?
```
int ExpensiveExtractCost = std::max(Extract0Cost, Extract1Cost);
(void)ExpensiveExtractCost;
// FIXME: introduce TargetTransformInfo::SK_Splat.
assert(TTI.getShuffleCost(TargetTransformInfo::SK_PermuteSingleSrc, VecTy) + CheapExtractCost
<=
TTI.getShuffleCost(TargetTransformInfo::SK_Broadcast, VecTy) + ExpensiveExtractCost
);
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75689/new/
https://reviews.llvm.org/D75689
More information about the llvm-commits
mailing list