@@ -9324,10 +9324,8 @@ static void addScalarResumePhis(VPRecipeBuilder &Builder, VPlan &Plan,
9324
9324
VPBuilder ScalarPHBuilder (ScalarPH);
9325
9325
VPValue *OneVPV = Plan.getOrAddLiveIn (
9326
9326
ConstantInt::get (Plan.getCanonicalIV ()->getScalarType (), 1 ));
9327
- for (VPRecipeBase &ScalarPhiR : *Plan.getScalarHeader ()) {
9328
- auto *ScalarPhiIRI = dyn_cast<VPIRPhi>(&ScalarPhiR);
9329
- if (!ScalarPhiIRI)
9330
- break ;
9327
+ for (VPRecipeBase &ScalarPhiR : Plan.getScalarHeader ()->phis ()) {
9328
+ auto *ScalarPhiIRI = cast<VPIRPhi>(&ScalarPhiR);
9331
9329
9332
9330
// TODO: Extract final value from induction recipe initially, optimize to
9333
9331
// pre-computed end value together in optimizeInductionExitUsers.
@@ -9381,10 +9379,8 @@ collectUsersInExitBlocks(Loop *OrigLoop, VPRecipeBuilder &Builder,
9381
9379
if (ExitVPBB->getNumPredecessors () == 0 )
9382
9380
continue ;
9383
9381
9384
- for (VPRecipeBase &R : *ExitVPBB) {
9385
- auto *ExitIRI = dyn_cast<VPIRPhi>(&R);
9386
- if (!ExitIRI)
9387
- break ;
9382
+ for (VPRecipeBase &R : ExitVPBB->phis ()) {
9383
+ auto *ExitIRI = cast<VPIRPhi>(&R);
9388
9384
if (ExitVPBB->getSinglePredecessor () != Plan.getMiddleBlock ()) {
9389
9385
assert (ExitIRI->getNumOperands () ==
9390
9386
ExitVPBB->getPredecessors ().size () &&
@@ -10579,10 +10575,9 @@ static void preparePlanForMainVectorLoop(VPlan &MainPlan, VPlan &EpiPlan) {
10579
10575
EpiWidenedPhis.insert (
10580
10576
cast<PHINode>(R.getVPSingleValue ()->getUnderlyingValue ()));
10581
10577
}
10582
- for (VPRecipeBase &R : make_early_inc_range (*MainPlan.getScalarHeader ())) {
10583
- auto *VPIRInst = dyn_cast<VPIRPhi>(&R);
10584
- if (!VPIRInst)
10585
- break ;
10578
+ for (VPRecipeBase &R :
10579
+ make_early_inc_range (MainPlan.getScalarHeader ()->phis ())) {
10580
+ auto *VPIRInst = cast<VPIRPhi>(&R);
10586
10581
if (EpiWidenedPhis.contains (&VPIRInst->getIRPhi ()))
10587
10582
continue ;
10588
10583
// There is no corresponding wide induction in the epilogue plan that would
0 commit comments