@@ -3692,10 +3692,10 @@ bool VectorCombine::foldInterleaveIntrinsics(Instruction &I) {
3692
3692
return true ;
3693
3693
}
3694
3694
3695
- // Attempt to narrow a phi of shufflevector instructions where the two incoming
3696
- // values have the same operands but different masks. If the two shuffle masks
3697
- // are offsets of one another we can use one branch to rotate the incoming
3698
- // vector and perform one larger shuffle after the phi.
3695
+ // / Attempt to narrow a phi of shufflevector instructions where the two incoming
3696
+ // / values have the same operands but different masks. If the two shuffle masks
3697
+ // / are offsets of one another we can use one branch to rotate the incoming
3698
+ // / vector and perform one larger shuffle after the phi.
3699
3699
bool VectorCombine::shrinkPhiOfShuffles (Instruction &I) {
3700
3700
auto *Phi = dyn_cast<PHINode>(&I);
3701
3701
if (!Phi || Phi->getNumIncomingValues () != 2u )
@@ -3738,8 +3738,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
3738
3738
// Ensure all elements of the new mask are equal. If the difference between
3739
3739
// the incoming mask elements is the same, the two must be constant offsets
3740
3740
// of one another.
3741
- if (NewMask.empty () ||
3742
- !std::equal (NewMask.begin () + 1u , NewMask.end (), NewMask.begin ()))
3741
+ if (NewMask.empty () || !all_equal (NewMask))
3743
3742
return false ;
3744
3743
3745
3744
// Create new mask using difference of the two incoming masks.
@@ -3763,8 +3762,7 @@ bool VectorCombine::shrinkPhiOfShuffles(Instruction &I) {
3763
3762
return false ;
3764
3763
3765
3764
// Create new shuffles and narrowed phi.
3766
- auto Builder = IRBuilder (&I);
3767
- Builder.SetInsertPoint (Shuf);
3765
+ auto Builder = IRBuilder (Shuf);
3768
3766
Builder.SetCurrentDebugLocation (Shuf->getDebugLoc ());
3769
3767
auto *PoisonVal = PoisonValue::get (InputVT);
3770
3768
auto *NewShuf0 = Builder.CreateShuffleVector (Op, PoisonVal, NewMask);
0 commit comments