5959#include " VPlan.h"
6060#include " VPlanAnalysis.h"
6161#include " VPlanCFG.h"
62- #include " VPlanHCFGBuilder.h"
6362#include " VPlanHelpers.h"
6463#include " VPlanPatternMatch.h"
6564#include " VPlanTransforms.h"
@@ -9306,13 +9305,8 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
93069305 return !CM.requiresScalarEpilogue (VF.isVector ());
93079306 },
93089307 Range);
9309- auto Plan = std::make_unique<VPlan>(OrigLoop);
9310- // Build hierarchical CFG.
9311- // TODO: Convert to VPlan-transform and consoliate all transforms for VPlan
9312- // creation.
9313- VPlanHCFGBuilder HCFGBuilder (OrigLoop, LI, *Plan);
9314- HCFGBuilder.buildPlainCFG ();
9315-
9308+ DenseMap<VPBlockBase *, BasicBlock *> VPB2IRBB;
9309+ auto Plan = VPlanTransforms::buildPlainCFG (OrigLoop, *LI, VPB2IRBB);
93169310 VPlanTransforms::introduceTopLevelVectorLoopRegion (
93179311 *Plan, Legal->getWidestInductionType (), PSE, RequiresScalarEpilogueCheck,
93189312 CM.foldTailByMasking (), OrigLoop);
@@ -9391,7 +9385,7 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
93919385 for (VPBasicBlock *VPBB : VPBlockUtils::blocksOnly<VPBasicBlock>(RPOT)) {
93929386 // Handle VPBBs down to the latch.
93939387 if (VPBB == LoopRegion->getExiting ()) {
9394- assert (!HCFGBuilder. getIRBBForVPB (VPBB) &&
9388+ assert (!VPB2IRBB. contains (VPBB) &&
93959389 " the latch block shouldn't have a corresponding IRBB" );
93969390 VPBlockUtils::connectBlocks (PrevVPBB, VPBB);
93979391 break ;
@@ -9407,7 +9401,7 @@ LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VFRange &Range) {
94079401 // FIXME: At the moment, masks need to be placed at the beginning of the
94089402 // block, as blends introduced for phi nodes need to use it. The created
94099403 // blends should be sunk after the mask recipes.
9410- RecipeBuilder.createBlockInMask (HCFGBuilder. getIRBBForVPB (VPBB));
9404+ RecipeBuilder.createBlockInMask (VPB2IRBB. lookup (VPBB));
94119405 }
94129406
94139407 // Convert input VPInstructions to widened recipes.
@@ -9610,13 +9604,8 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VFRange &Range) {
96109604 // the vectorization pipeline.
96119605 assert (!OrigLoop->isInnermost ());
96129606 assert (EnableVPlanNativePath && " VPlan-native path is not enabled." );
9613-
9614- // Create new empty VPlan
9615- auto Plan = std::make_unique<VPlan>(OrigLoop);
9616- // Build hierarchical CFG
9617- VPlanHCFGBuilder HCFGBuilder (OrigLoop, LI, *Plan);
9618- HCFGBuilder.buildPlainCFG ();
9619-
9607+ DenseMap<VPBlockBase *, BasicBlock *> VPB2IRBB;
9608+ auto Plan = VPlanTransforms::buildPlainCFG (OrigLoop, *LI, VPB2IRBB);
96209609 VPlanTransforms::introduceTopLevelVectorLoopRegion (
96219610 *Plan, Legal->getWidestInductionType (), PSE, true , false , OrigLoop);
96229611
0 commit comments