@@ -503,12 +503,11 @@ void VPlanTransforms::removeDeadRecipes(VPlan &Plan) {
503
503
504
504
static VPValue *createScalarIVSteps (VPlan &Plan, const InductionDescriptor &ID,
505
505
ScalarEvolution &SE, Instruction *TruncI,
506
- Type *IVTy, VPValue *StartV) {
506
+ Type *IVTy, VPValue *StartV,
507
+ VPValue *Step) {
507
508
VPBasicBlock *HeaderVPBB = Plan.getVectorLoopRegion ()->getEntryBasicBlock ();
508
509
auto IP = HeaderVPBB->getFirstNonPhi ();
509
510
VPCanonicalIVPHIRecipe *CanonicalIV = Plan.getCanonicalIV ();
510
- VPValue *Step =
511
- vputils::getOrCreateVPValueForSCEVExpr (Plan, ID.getStep (), SE);
512
511
Type *TruncTy = TruncI ? TruncI->getType () : IVTy;
513
512
VPValue *BaseIV = CanonicalIV;
514
513
if (!CanonicalIV->isCanonical (ID.getKind (), StartV, Step, TruncTy)) {
@@ -535,9 +534,9 @@ void VPlanTransforms::optimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
535
534
continue ;
536
535
537
536
const InductionDescriptor &ID = WideIV->getInductionDescriptor ();
538
- VPValue *Steps = createScalarIVSteps (Plan, ID, SE, WideIV-> getTruncInst (),
539
- WideIV->getPHINode ()->getType (),
540
- WideIV->getStartValue ());
537
+ VPValue *Steps = createScalarIVSteps (
538
+ Plan, ID, SE, WideIV-> getTruncInst (), WideIV->getPHINode ()->getType (),
539
+ WideIV->getStartValue (), WideIV-> getStepValue ());
541
540
542
541
// Update scalar users of IV to use Step instead. Use SetVector to ensure
543
542
// the list of users doesn't contain duplicates.
0 commit comments