Skip to content

Commit c3b32b1

Browse files
author
Leon Clark
committed
Address comments.
1 parent 4212fbb commit c3b32b1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

llvm/lib/Transforms/Vectorize/VectorCombine.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,8 +4041,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
40414041
// Ensure all elements of the new mask are equal. If the difference between
40424042
// the incoming mask elements is the same, the two must be constant offsets
40434043
// of one another.
4044-
if (NewMask.empty() ||
4045-
!std::equal(NewMask.begin() + 1u, NewMask.end(), NewMask.begin()))
4044+
if (NewMask.empty() || !all_equal(NewMask))
40464045
return false;
40474046

40484047
// Create new mask using difference of the two incoming masks.
@@ -4066,8 +4065,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
40664065
return false;
40674066

40684067
// Create new shuffles and narrowed phi.
4069-
auto Builder = IRBuilder(&I);
4070-
Builder.SetInsertPoint(Shuf);
4068+
auto Builder = IRBuilder(Shuf);
40714069
Builder.SetCurrentDebugLocation(Shuf->getDebugLoc());
40724070
auto *PoisonVal = PoisonValue::get(InputVT);
40734071
auto *NewShuf0 = Builder.CreateShuffleVector(Op, PoisonVal, NewMask);

0 commit comments

Comments
 (0)