@@ -506,13 +506,12 @@ static void removeDeadRecipes(VPlan &Plan) {
506
506
}
507
507
}
508
508
509
- static VPValue *createScalarIVSteps (VPlan &Plan,
510
- InductionDescriptor::InductionKind Kind,
511
- Instruction::BinaryOps InductionOpcode,
512
- FPMathOperator *FPBinOp,
513
- ScalarEvolution &SE, Instruction *TruncI,
514
- VPValue *StartV, VPValue *Step,
515
- VPBasicBlock::iterator IP) {
509
+ static VPScalarIVStepsRecipe *
510
+ createScalarIVSteps (VPlan &Plan, InductionDescriptor::InductionKind Kind,
511
+ Instruction::BinaryOps InductionOpcode,
512
+ FPMathOperator *FPBinOp, ScalarEvolution &SE,
513
+ Instruction *TruncI, VPValue *StartV, VPValue *Step,
514
+ VPBasicBlock::iterator IP) {
516
515
VPBasicBlock *HeaderVPBB = Plan.getVectorLoopRegion ()->getEntryBasicBlock ();
517
516
VPCanonicalIVPHIRecipe *CanonicalIV = Plan.getCanonicalIV ();
518
517
VPSingleDefRecipe *BaseIV = CanonicalIV;
@@ -579,16 +578,13 @@ static void legalizeAndOptimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
579
578
VPValue *StartV =
580
579
Plan.getOrAddLiveIn (ConstantInt::get (ID.getStep ()->getType (), 0 ));
581
580
VPValue *StepV = PtrIV->getOperand (1 );
582
- VPRecipeBase *Steps =
583
- createScalarIVSteps (Plan, InductionDescriptor::IK_IntInduction,
584
- Instruction::Add, nullptr , SE, nullptr , StartV,
585
- StepV, InsertPt)
586
- ->getDefiningRecipe ();
581
+ VPScalarIVStepsRecipe *Steps = createScalarIVSteps (
582
+ Plan, InductionDescriptor::IK_IntInduction, Instruction::Add, nullptr ,
583
+ SE, nullptr , StartV, StepV, InsertPt);
587
584
588
- auto *Recipe =
589
- new VPInstruction (VPInstruction::PtrAdd,
590
- {PtrIV->getStartValue (), Steps->getVPSingleValue ()},
591
- PtrIV->getDebugLoc (), " next.gep" );
585
+ auto *Recipe = new VPInstruction (VPInstruction::PtrAdd,
586
+ {PtrIV->getStartValue (), Steps},
587
+ PtrIV->getDebugLoc (), " next.gep" );
592
588
593
589
Recipe->insertAfter (Steps);
594
590
PtrIV->replaceAllUsesWith (Recipe);
@@ -606,7 +602,7 @@ static void legalizeAndOptimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
606
602
continue ;
607
603
608
604
const InductionDescriptor &ID = WideIV->getInductionDescriptor ();
609
- VPValue *Steps = createScalarIVSteps (
605
+ VPScalarIVStepsRecipe *Steps = createScalarIVSteps (
610
606
Plan, ID.getKind (), ID.getInductionOpcode (),
611
607
dyn_cast_or_null<FPMathOperator>(ID.getInductionBinOp ()), SE,
612
608
WideIV->getTruncInst (), WideIV->getStartValue (), WideIV->getStepValue (),
0 commit comments