@@ -523,7 +523,7 @@ static void removeDeadRecipes(VPlan &Plan) {
523
523
static VPScalarIVStepsRecipe *
524
524
createScalarIVSteps (VPlan &Plan, InductionDescriptor::InductionKind Kind,
525
525
Instruction::BinaryOps InductionOpcode,
526
- FPMathOperator *FPBinOp, ScalarEvolution &SE ,
526
+ FPMathOperator *FPBinOp, LLVMContext &Ctx ,
527
527
Instruction *TruncI, VPValue *StartV, VPValue *Step,
528
528
VPBasicBlock::iterator IP) {
529
529
VPBasicBlock *HeaderVPBB = Plan.getVectorLoopRegion ()->getEntryBasicBlock ();
@@ -535,8 +535,7 @@ createScalarIVSteps(VPlan &Plan, InductionDescriptor::InductionKind Kind,
535
535
}
536
536
537
537
// Truncate base induction if needed.
538
- VPTypeAnalysis TypeInfo (Plan.getCanonicalIV ()->getScalarType (),
539
- SE.getContext ());
538
+ VPTypeAnalysis TypeInfo (Plan.getCanonicalIV ()->getScalarType (), Ctx);
540
539
Type *ResultTy = TypeInfo.inferScalarType (BaseIV);
541
540
if (TruncI) {
542
541
Type *TruncTy = TruncI->getType ();
@@ -576,7 +575,7 @@ createScalarIVSteps(VPlan &Plan, InductionDescriptor::InductionKind Kind,
576
575
// / if any of its users needs scalar values, by providing them scalar steps
577
576
// / built on the canonical scalar IV and update the original IV's users. This is
578
577
// / an optional optimization to reduce the needs of vector extracts.
579
- static void legalizeAndOptimizeInductions (VPlan &Plan, ScalarEvolution &SE ) {
578
+ static void legalizeAndOptimizeInductions (VPlan &Plan, LLVMContext &Ctx ) {
580
579
SmallVector<VPRecipeBase *> ToRemove;
581
580
VPBasicBlock *HeaderVPBB = Plan.getVectorLoopRegion ()->getEntryBasicBlock ();
582
581
bool HasOnlyVectorVFs = !Plan.hasVF (ElementCount::getFixed (1 ));
@@ -594,7 +593,7 @@ static void legalizeAndOptimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
594
593
VPValue *StepV = PtrIV->getOperand (1 );
595
594
VPScalarIVStepsRecipe *Steps = createScalarIVSteps (
596
595
Plan, InductionDescriptor::IK_IntInduction, Instruction::Add, nullptr ,
597
- SE , nullptr , StartV, StepV, InsertPt);
596
+ Ctx , nullptr , StartV, StepV, InsertPt);
598
597
599
598
auto *Recipe = new VPInstruction (VPInstruction::PtrAdd,
600
599
{PtrIV->getStartValue (), Steps},
@@ -618,7 +617,7 @@ static void legalizeAndOptimizeInductions(VPlan &Plan, ScalarEvolution &SE) {
618
617
const InductionDescriptor &ID = WideIV->getInductionDescriptor ();
619
618
VPScalarIVStepsRecipe *Steps = createScalarIVSteps (
620
619
Plan, ID.getKind (), ID.getInductionOpcode (),
621
- dyn_cast_or_null<FPMathOperator>(ID.getInductionBinOp ()), SE ,
620
+ dyn_cast_or_null<FPMathOperator>(ID.getInductionBinOp ()), Ctx ,
622
621
WideIV->getTruncInst (), WideIV->getStartValue (), WideIV->getStepValue (),
623
622
InsertPt);
624
623
@@ -1119,12 +1118,12 @@ void VPlanTransforms::truncateToMinimalBitwidths(
1119
1118
" some entries in MinBWs haven't been processed" );
1120
1119
}
1121
1120
1122
- void VPlanTransforms::optimize (VPlan &Plan, ScalarEvolution &SE ) {
1121
+ void VPlanTransforms::optimize (VPlan &Plan, LLVMContext &Ctx ) {
1123
1122
removeRedundantCanonicalIVs (Plan);
1124
1123
removeRedundantInductionCasts (Plan);
1125
1124
1126
- simplifyRecipes (Plan, SE. getContext () );
1127
- legalizeAndOptimizeInductions (Plan, SE );
1125
+ simplifyRecipes (Plan, Ctx );
1126
+ legalizeAndOptimizeInductions (Plan, Ctx );
1128
1127
removeDeadRecipes (Plan);
1129
1128
1130
1129
createAndOptimizeReplicateRegions (Plan);
0 commit comments