Skip to content

Commit f4fd449

Browse files
author
Leon Clark
committed
Address review comments.
1 parent c3b32b1 commit f4fd449

File tree

3 files changed

+6464
-1270
lines changed

3 files changed

+6464
-1270
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4029,10 +4029,10 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
40294029
SmallVector<int, 16> NewMask;
40304030
NewMask.reserve(Mask0.size());
40314031

4032-
for (auto I = 0u; I < Mask0.size(); ++I) {
4033-
if (Mask0[I] >= 0 && Mask1[I] >= 0)
4034-
NewMask.push_back(Mask0[I] - Mask1[I]);
4035-
else if (Mask0[I] == -1 && Mask1[I] == -1)
4032+
for (auto [M0, M1] : zip(Mask0, Mask1)) {
4033+
if (M0 >= 0 && M1 >= 0)
4034+
NewMask.push_back(M0 - M1);
4035+
else if (M0 == -1 && M1 == -1)
40364036
continue;
40374037
else
40384038
return false;
@@ -4069,6 +4069,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
40694069
Builder.SetCurrentDebugLocation(Shuf->getDebugLoc());
40704070
auto *PoisonVal = PoisonValue::get(InputVT);
40714071
auto *NewShuf0 = Builder.CreateShuffleVector(Op, PoisonVal, NewMask);
4072+
Worklist.push(cast<Instruction>(NewShuf0));
40724073

40734074
Builder.SetInsertPoint(Phi);
40744075
Builder.SetCurrentDebugLocation(Phi->getDebugLoc());

0 commit comments

Comments
 (0)