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 {
1394913949 }))
1395013950 return true;
1395113951
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+
1395213965 // We can vectorize the tree if its size is greater than or equal to the
1395313966 // minimum size specified by the MinTreeSize command line option.
1395413967 if (VectorizableTree.size() >= MinTreeSize)
You can’t perform that action at this time.
0 commit comments