@@ -495,7 +495,8 @@ Value *VPInstruction::generate(VPTransformState &State) {
495495 getParent ()->getPlan ()->getVectorLoopRegion ()->getEntry () &&
496496 " VPInstructions with PHI opcodes must be used for header phis only "
497497 " at the moment" );
498- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
498+ BasicBlock *VectorPH =
499+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
499500 Value *Start = State.get (getOperand (0 ), VPLane (0 ));
500501 PHINode *Phi = State.Builder .CreatePHI (Start->getType (), 2 , Name);
501502 Phi->addIncoming (Start, VectorPH);
@@ -1956,7 +1957,8 @@ void VPWidenIntOrFpInductionRecipe::execute(VPTransformState &State) {
19561957
19571958 // Construct the initial value of the vector IV in the vector loop preheader
19581959 auto CurrIP = Builder.saveIP ();
1959- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
1960+ BasicBlock *VectorPH =
1961+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
19601962 Builder.SetInsertPoint (VectorPH->getTerminator ());
19611963 if (isa<TruncInst>(EntryVal)) {
19621964 assert (Start->getType ()->isIntegerTy () &&
@@ -3507,7 +3509,8 @@ void VPWidenPointerInductionRecipe::execute(VPTransformState &State) {
35073509 Value *ScalarStartValue = getStartValue ()->getLiveInIRValue ();
35083510 Type *ScStValueType = ScalarStartValue->getType ();
35093511
3510- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3512+ BasicBlock *VectorPH =
3513+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
35113514 PHINode *NewPointerPhi = nullptr ;
35123515 if (CurrentPart == 0 ) {
35133516 IRBuilder<>::InsertPointGuard Guard (State.Builder );
@@ -3648,7 +3651,8 @@ void VPFirstOrderRecurrencePHIRecipe::execute(VPTransformState &State) {
36483651 ? VectorInit->getType ()
36493652 : VectorType::get (VectorInit->getType (), State.VF );
36503653
3651- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3654+ BasicBlock *VectorPH =
3655+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
36523656 if (State.VF .isVector ()) {
36533657 auto *IdxTy = Builder.getInt32Ty ();
36543658 auto *One = ConstantInt::get (IdxTy, 1 );
@@ -3716,7 +3720,8 @@ void VPReductionPHIRecipe::execute(VPTransformState &State) {
37163720 Phi->insertBefore (HeaderBB->getFirstInsertionPt ());
37173721 State.set (this , Phi, IsInLoop);
37183722
3719- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3723+ BasicBlock *VectorPH =
3724+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
37203725
37213726 Value *Iden = nullptr ;
37223727 RecurKind RK = RdxDesc.getRecurrenceKind ();
@@ -3810,7 +3815,8 @@ void VPWidenPHIRecipe::print(raw_ostream &O, const Twine &Indent,
38103815// TODO: It would be good to use the existing VPWidenPHIRecipe instead and
38113816// remove VPActiveLaneMaskPHIRecipe.
38123817void VPActiveLaneMaskPHIRecipe::execute (VPTransformState &State) {
3813- BasicBlock *VectorPH = State.CFG .getPreheaderBBFor (this );
3818+ BasicBlock *VectorPH =
3819+ State.CFG .VPBB2IRBB .at (getParent ()->getCFGPredecessor (0 ));
38143820 Value *StartMask = State.get (getOperand (0 ));
38153821 PHINode *Phi =
38163822 State.Builder .CreatePHI (StartMask->getType (), 2 , " active.lane.mask" );
0 commit comments