@@ -495,7 +495,8 @@ Value *VPInstruction::generate(VPTransformState &State) {
495
495
getParent ()->getPlan ()->getVectorLoopRegion ()->getEntry () &&
496
496
" VPInstructions with PHI opcodes must be used for header phis only "
497
497
" at the moment" );
498
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
498
+ BasicBlock *VectorPH =
499
+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
499
500
Value *Start = State.get (getOperand (0 ), VPLane (0 ));
500
501
PHINode *Phi = State.Builder .CreatePHI (Start->getType (), 2 , Name);
501
502
Phi->addIncoming (Start, VectorPH);
@@ -1956,7 +1957,8 @@ void VPWidenIntOrFpInductionRecipe::execute(VPTransformState &State) {
1956
1957
1957
1958
// Construct the initial value of the vector IV in the vector loop preheader
1958
1959
auto CurrIP = Builder.saveIP ();
1959
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
1960
+ BasicBlock *VectorPH =
1961
+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
1960
1962
Builder.SetInsertPoint (VectorPH->getTerminator ());
1961
1963
if (isa<TruncInst>(EntryVal)) {
1962
1964
assert (Start->getType ()->isIntegerTy () &&
@@ -3507,7 +3509,8 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
3507
3509
Value *ScalarStartValue = getStartValue ()->getLiveInIRValue ();
3508
3510
Type *ScStValueType = ScalarStartValue->getType ();
3509
3511
3510
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3512
+ BasicBlock *VectorPH =
3513
+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
3511
3514
PHINode *NewPointerPhi = nullptr ;
3512
3515
if (CurrentPart == 0 ) {
3513
3516
IRBuilder<>::InsertPointGuard Guard (State.Builder );
@@ -3648,7 +3651,8 @@ void VPFirstOrderRecurrencePHIRecipe::execute(VPTransformState &State) {
3648
3651
? VectorInit->getType ()
3649
3652
: VectorType::get (VectorInit->getType (), State.VF );
3650
3653
3651
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3654
+ BasicBlock *VectorPH =
3655
+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
3652
3656
if (State.VF .isVector ()) {
3653
3657
auto *IdxTy = Builder.getInt32Ty ();
3654
3658
auto *One = ConstantInt::get (IdxTy, 1 );
@@ -3716,7 +3720,8 @@ void VPReductionPHIRecipe::execute(VPTransformState &State) {
3716
3720
Phi->insertBefore (HeaderBB->getFirstInsertionPt ());
3717
3721
State.set (this , Phi, IsInLoop);
3718
3722
3719
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3723
+ BasicBlock *VectorPH =
3724
+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
3720
3725
3721
3726
Value *Iden = nullptr ;
3722
3727
RecurKind RK = RdxDesc.getRecurrenceKind ();
@@ -3810,7 +3815,8 @@ void VPWidenPHIRecipe::print(raw_ostream &O, const Twine &Indent,
3810
3815
// TODO: It would be good to use the existing VPWidenPHIRecipe instead and
3811
3816
// remove VPActiveLaneMaskPHIRecipe.
3812
3817
void VPActiveLaneMaskPHIRecipe::execute (VPTransformState &State) {
3813
- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3818
+ BasicBlock *VectorPH =
3819
+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
3814
3820
Value *StartMask = State.get (getOperand (0 ));
3815
3821
PHINode *Phi =
3816
3822
State.Builder .CreatePHI (StartMask->getType (), 2 , " active.lane.mask" );
0 commit comments