File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2883,6 +2883,10 @@ class BoUpSLP {
2883
2883
assert(!BundleMember && "Bundle and VL out of sync");
2884
2884
} else {
2885
2885
MustGather.insert(VL.begin(), VL.end());
2886
+ // Build a map for gathered scalars to the nodes where they are used.
2887
+ for (Value *V : VL)
2888
+ if (!isConstant(V))
2889
+ ValueToGatherNodes.try_emplace(V).first->getSecond().insert(Last);
2886
2890
}
2887
2891
2888
2892
if (UserTreeIdx.UserTE)
@@ -8865,16 +8869,6 @@ static T *performExtractsShuffleAction(
8865
8869
}
8866
8870
8867
8871
InstructionCost BoUpSLP::getTreeCost(ArrayRef<Value *> VectorizedVals) {
8868
- // Build a map for gathered scalars to the nodes where they are used.
8869
- ValueToGatherNodes.clear();
8870
- for (const std::unique_ptr<TreeEntry> &EntryPtr : VectorizableTree) {
8871
- if (EntryPtr->State != TreeEntry::NeedToGather)
8872
- continue;
8873
- for (Value *V : EntryPtr->Scalars)
8874
- if (!isConstant(V))
8875
- ValueToGatherNodes.try_emplace(V).first->getSecond().insert(
8876
- EntryPtr.get());
8877
- }
8878
8872
InstructionCost Cost = 0;
8879
8873
LLVM_DEBUG(dbgs() << "SLP: Calculating cost for tree of size "
8880
8874
<< VectorizableTree.size() << ".\n");
You can’t perform that action at this time.
0 commit comments