Skip to content

Commit 20b2c9f

Browse files
committed
[SLP][NFC]Use GatheredScalars vector instead of the original E->Scalars, NFC
GateredScalars is a full copy of the E->Scalars in this places and can be safely used for now. Unifies the code across the function.
1 parent 4c2f90f commit 20b2c9f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13096,12 +13096,12 @@ ResTy BoUpSLP::processBuildVector(const TreeEntry *E, Type *ScalarTy,
1309613096
Res = ShuffleBuilder.finalize(E->ReuseShuffleIndices);
1309713097
} else {
1309813098
// Gather all constants.
13099-
SmallVector<int> Mask(E->Scalars.size(), PoisonMaskElem);
13100-
for (auto [I, V] : enumerate(E->Scalars)) {
13099+
SmallVector<int> Mask(GatheredScalars.size(), PoisonMaskElem);
13100+
for (auto [I, V] : enumerate(GatheredScalars)) {
1310113101
if (!isa<PoisonValue>(V))
1310213102
Mask[I] = I;
1310313103
}
13104-
Value *BV = ShuffleBuilder.gather(E->Scalars);
13104+
Value *BV = ShuffleBuilder.gather(GatheredScalars);
1310513105
ShuffleBuilder.add(BV, Mask);
1310613106
Res = ShuffleBuilder.finalize(E->ReuseShuffleIndices);
1310713107
}

0 commit comments

Comments
 (0)