[VPlan] Set VFs included in plan before last set of VPTransforms (NFC).

This allows VPlanTransforms to query the VFs included in the plan in the
future.
This commit is contained in:
Florian Hahn 2022-06-24 10:16:55 +02:00
parent c0d4f2282d
commit b18141a8f2
No known key found for this signature in database
GPG Key ID: CF59919C6547A668
1 changed files with 10 additions and 10 deletions

View File

@ -9000,16 +9000,6 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
}
}
// From this point onwards, VPlan-to-VPlan transformations may change the plan
// in ways that accessing values using original IR values is incorrect.
Plan->disableValue2VPValue();
VPlanTransforms::optimizeInductions(*Plan, *PSE.getSE());
VPlanTransforms::sinkScalarOperands(*Plan);
VPlanTransforms::mergeReplicateRegions(*Plan);
VPlanTransforms::removeDeadRecipes(*Plan);
VPlanTransforms::removeRedundantExpandSCEVRecipes(*Plan);
std::string PlanName;
raw_string_ostream RSO(PlanName);
ElementCount VF = Range.Start;
@ -9023,6 +9013,16 @@ VPlanPtr LoopVectorizationPlanner::buildVPlanWithVPRecipes(
RSO.flush();
Plan->setName(PlanName);
// From this point onwards, VPlan-to-VPlan transformations may change the plan
// in ways that accessing values using original IR values is incorrect.
Plan->disableValue2VPValue();
VPlanTransforms::optimizeInductions(*Plan, *PSE.getSE());
VPlanTransforms::sinkScalarOperands(*Plan);
VPlanTransforms::mergeReplicateRegions(*Plan);
VPlanTransforms::removeDeadRecipes(*Plan);
VPlanTransforms::removeRedundantExpandSCEVRecipes(*Plan);
// Fold Exit block into its predecessor if possible.
// TODO: Fold block earlier once all VPlan transforms properly maintain a
// VPBasicBlock as exit.