Skip to content

Commit aca0aaa

Browse files
author
Leon Clark
committed
Address review comments.
1 parent cae4e9b commit aca0aaa

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
@@ -3554,10 +3554,10 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
35543554
SmallVector<int, 16> NewMask;
35553555
NewMask.reserve(Mask0.size());
35563556

3557-
for (auto I = 0u; I < Mask0.size(); ++I) {
3558-
if (Mask0[I] >= 0 && Mask1[I] >= 0)
3559-
NewMask.push_back(Mask0[I] - Mask1[I]);
3560-
else if (Mask0[I] == -1 && Mask1[I] == -1)
3557+
for (auto [M0, M1] : zip(Mask0, Mask1)) {
3558+
if (M0 >= 0 && M1 >= 0)
3559+
NewMask.push_back(M0 - M1);
3560+
else if (M0 == -1 && M1 == -1)
35613561
continue;
35623562
else
35633563
return false;
@@ -3594,6 +3594,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
35943594
Builder.SetCurrentDebugLocation(Shuf->getDebugLoc());
35953595
auto *PoisonVal = PoisonValue::get(InputVT);
35963596
auto *NewShuf0 = Builder.CreateShuffleVector(Op, PoisonVal, NewMask);
3597+
Worklist.push(cast<Instruction>(NewShuf0));
35973598

35983599
Builder.SetInsertPoint(Phi);
35993600
Builder.SetCurrentDebugLocation(Phi->getDebugLoc());

0 commit comments

Comments
 (0)