@@ -3520,10 +3520,10 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) {
3520
3520
return true ;
3521
3521
}
3522
3522
3523
- // Attempt to narrow a phi of shufflevector instructions where the two incoming
3524
- // values have the same operands but different masks. If the two shuffle masks
3525
- // are offsets of one another we can use one branch to rotate the incoming
3526
- // vector and perform one larger shuffle after the phi.
3523
+ // / Attempt to narrow a phi of shufflevector instructions where the two incoming
3524
+ // / values have the same operands but different masks. If the two shuffle masks
3525
+ // / are offsets of one another we can use one branch to rotate the incoming
3526
+ // / vector and perform one larger shuffle after the phi.
3527
3527
bool VectorCombine::shrinkPhiOfShuffles (Instruction &I) {
3528
3528
auto *Phi = dyn_cast<PHINode>(&I);
3529
3529
if (!Phi || Phi->getNumIncomingValues () != 2u )
@@ -3566,8 +3566,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
3566
3566
// Ensure all elements of the new mask are equal. If the difference between
3567
3567
// the incoming mask elements is the same, the two must be constant offsets
3568
3568
// of one another.
3569
- if (NewMask.empty () ||
3570
- !std::equal (NewMask.begin () + 1u , NewMask.end (), NewMask.begin ()))
3569
+ if (NewMask.empty () || !all_equal (NewMask))
3571
3570
return false ;
3572
3571
3573
3572
// Create new mask using difference of the two incoming masks.
@@ -3591,8 +3590,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
3591
3590
return false ;
3592
3591
3593
3592
// Create new shuffles and narrowed phi.
3594
- auto Builder = IRBuilder (&I);
3595
- Builder.SetInsertPoint (Shuf);
3593
+ auto Builder = IRBuilder (Shuf);
3596
3594
Builder.SetCurrentDebugLocation (Shuf->getDebugLoc ());
3597
3595
auto *PoisonVal = PoisonValue::get (InputVT);
3598
3596
auto *NewShuf0 = Builder.CreateShuffleVector (Op, PoisonVal, NewMask);
0 commit comments