File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -13949,6 +13949,19 @@ bool BoUpSLP::isTreeTinyAndNotFullyVectorizable(bool ForReduction) const {
13949
13949
}))
13950
13950
return true;
13951
13951
13952
+ // If the tree contains only phis, buildvectors, split nodes and
13953
+ // small nodes with reuses, we can skip it.
13954
+ if (!ForReduction && !SLPCostThreshold.getNumOccurrences() &&
13955
+ all_of(VectorizableTree, [](const std::unique_ptr<TreeEntry> &TE) {
13956
+ return TE->State == TreeEntry::SplitVectorize ||
13957
+ (TE->isGather() &&
13958
+ none_of(TE->Scalars, IsaPred<ExtractElementInst>)) ||
13959
+ (TE->hasState() && (TE->getOpcode() == Instruction::PHI ||
13960
+ (!TE->ReuseShuffleIndices.empty() &&
13961
+ TE->Scalars.size() == 2)));
13962
+ }))
13963
+ return true;
13964
+
13952
13965
// We can vectorize the tree if its size is greater than or equal to the
13953
13966
// minimum size specified by the MinTreeSize command line option.
13954
13967
if (VectorizableTree.size() >= MinTreeSize)
You can’t perform that action at this time.
0 commit comments