@@ -863,10 +863,10 @@ VPlan::~VPlan() {
863
863
delete BackedgeTakenCount;
864
864
}
865
865
866
- static VPIRBasicBlock *createVPIRBasicBlockFor (BasicBlock *BB ) {
867
- auto *VPIRBB = new VPIRBasicBlock (BB );
866
+ VPIRBasicBlock *VPIRBasicBlock::fromBasicBlock (BasicBlock *IRBB ) {
867
+ auto *VPIRBB = new VPIRBasicBlock (IRBB );
868
868
for (Instruction &I :
869
- make_range (BB ->begin (), BB ->getTerminator ()->getIterator ()))
869
+ make_range (IRBB ->begin (), IRBB ->getTerminator ()->getIterator ()))
870
870
VPIRBB->appendRecipe (new VPIRInstruction (I));
871
871
return VPIRBB;
872
872
}
@@ -875,7 +875,8 @@ VPlanPtr VPlan::createInitialVPlan(Type *InductionTy,
875
875
PredicatedScalarEvolution &PSE,
876
876
bool RequiresScalarEpilogueCheck,
877
877
bool TailFolded, Loop *TheLoop) {
878
- VPIRBasicBlock *Entry = createVPIRBasicBlockFor (TheLoop->getLoopPreheader ());
878
+ VPIRBasicBlock *Entry =
879
+ VPIRBasicBlock::fromBasicBlock (TheLoop->getLoopPreheader ());
879
880
VPBasicBlock *VecPreheader = new VPBasicBlock (" vector.ph" );
880
881
auto Plan = std::make_unique<VPlan>(Entry, VecPreheader);
881
882
@@ -915,7 +916,7 @@ VPlanPtr VPlan::createInitialVPlan(Type *InductionTy,
915
916
// we unconditionally branch to the scalar preheader. Do nothing.
916
917
// 3) Otherwise, construct a runtime check.
917
918
BasicBlock *IRExitBlock = TheLoop->getUniqueExitBlock ();
918
- auto *VPExitBlock = createVPIRBasicBlockFor (IRExitBlock);
919
+ auto *VPExitBlock = VPIRBasicBlock::fromBasicBlock (IRExitBlock);
919
920
// The connection order corresponds to the operands of the conditional branch.
920
921
VPBlockUtils::insertBlockAfter (VPExitBlock, MiddleVPBB);
921
922
VPBlockUtils::connectBlocks (MiddleVPBB, ScalarPH);
@@ -991,7 +992,7 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
991
992
// / have a single predecessor, which is rewired to the new VPIRBasicBlock. All
992
993
// / successors of VPBB, if any, are rewired to the new VPIRBasicBlock.
993
994
static void replaceVPBBWithIRVPBB (VPBasicBlock *VPBB, BasicBlock *IRBB) {
994
- VPIRBasicBlock *IRVPBB = createVPIRBasicBlockFor (IRBB);
995
+ VPIRBasicBlock *IRVPBB = VPIRBasicBlock::fromBasicBlock (IRBB);
995
996
for (auto &R : make_early_inc_range (*VPBB)) {
996
997
assert (!R.isPhi () && " Tried to move phi recipe to end of block" );
997
998
R.moveBefore (*IRVPBB, IRVPBB->end ());
0 commit comments