[VPlan] Simplify code in createReplicateRegion (NFC).
Simplify the code as suggested in D143865.
This commit is contained in:
@@ -8595,21 +8595,17 @@ VPRecipeBuilder::createReplicateRegion(VPReplicateRecipe *PredRecipe,
|
||||
PredRecipe->getUnderlyingInstr(),
|
||||
make_range(PredRecipe->op_begin(), std::prev(PredRecipe->op_end())),
|
||||
PredRecipe->isUniform());
|
||||
PredRecipe->replaceAllUsesWith(RecipeWithoutMask);
|
||||
PredRecipe->eraseFromParent();
|
||||
|
||||
auto *BOMRecipe = new VPBranchOnMaskRecipe(BlockInMask);
|
||||
auto *Entry = new VPBasicBlock(Twine(RegionName) + ".entry", BOMRecipe);
|
||||
auto *PHIRecipe = RecipeWithoutMask->getNumUsers() == 0
|
||||
? nullptr
|
||||
: new VPPredInstPHIRecipe(RecipeWithoutMask);
|
||||
if (PHIRecipe) {
|
||||
RecipeWithoutMask->replaceAllUsesWith(PHIRecipe);
|
||||
VPPredInstPHIRecipe *PHIRecipe = nullptr;
|
||||
if (PredRecipe->getNumUsers() != 0) {
|
||||
PHIRecipe = new VPPredInstPHIRecipe(RecipeWithoutMask);
|
||||
PredRecipe->replaceAllUsesWith(PHIRecipe);
|
||||
PHIRecipe->setOperand(0, RecipeWithoutMask);
|
||||
}
|
||||
|
||||
PredRecipe->eraseFromParent();
|
||||
auto *Exiting = new VPBasicBlock(Twine(RegionName) + ".continue", PHIRecipe);
|
||||
auto *Pred = new VPBasicBlock(Twine(RegionName) + ".if", RecipeWithoutMask);
|
||||
auto *BOMRecipe = new VPBranchOnMaskRecipe(BlockInMask);
|
||||
auto *Entry = new VPBasicBlock(Twine(RegionName) + ".entry", BOMRecipe);
|
||||
VPRegionBlock *Region = new VPRegionBlock(Entry, Exiting, RegionName, true);
|
||||
|
||||
// Note: first set Entry as region entry and then connect successors starting
|
||||
|
||||
Reference in New Issue
Block a user