Skip to content

Commit ba55ff0

Browse files
author
Leon Clark
committed
Address review comments.
1 parent 98fb688 commit ba55ff0

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
@@ -3726,10 +3726,10 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
37263726
SmallVector<int, 16> NewMask;
37273727
NewMask.reserve(Mask0.size());
37283728

3729-
for (auto I = 0u; I < Mask0.size(); ++I) {
3730-
if (Mask0[I] >= 0 && Mask1[I] >= 0)
3731-
NewMask.push_back(Mask0[I] - Mask1[I]);
3732-
else if (Mask0[I] == -1 && Mask1[I] == -1)
3729+
for (auto [M0, M1] : zip(Mask0, Mask1)) {
3730+
if (M0 >= 0 && M1 >= 0)
3731+
NewMask.push_back(M0 - M1);
3732+
else if (M0 == -1 && M1 == -1)
37333733
continue;
37343734
else
37353735
return false;
@@ -3766,6 +3766,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
37663766
Builder.SetCurrentDebugLocation(Shuf->getDebugLoc());
37673767
auto *PoisonVal = PoisonValue::get(InputVT);
37683768
auto *NewShuf0 = Builder.CreateShuffleVector(Op, PoisonVal, NewMask);
3769+
Worklist.push(cast<Instruction>(NewShuf0));
37693770

37703771
Builder.SetInsertPoint(Phi);
37713772
Builder.SetCurrentDebugLocation(Phi->getDebugLoc());

0 commit comments

Comments
 (0)