[PATCH] D143865: [VPlan] Add predicate to VPReplicateRecipe, expand region later.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 16 10:09:29 PDT 2023


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:8701
   auto *Entry = new VPBasicBlock(Twine(RegionName) + ".entry", BOMRecipe);
   auto *PHIRecipe = Instr->getType()->isVoidTy()
                         ? nullptr
----------------
fhahn wrote:
> Ayal wrote:
> > nit: now that this is a VPlan2VPlan transformation, check if PredRecipe has users instead of Instr's type?
> > 
> > While we're here, could perhaps be simplified into (independent of this patch):
> > 
> > ```
> > VPRecipeBase *PHIRecipe = nullptr;
> > if (PredRecipe has users outside its block) {
> >   PHIRecipe = new VPPredInstPHIRecipe(RecipeWithoutMask);
> >   RecipeWithoutMask->replaceAllUsesWith(PHIRecipe);
> >   PHIRecipe->setOperand(0, RecipeWithoutMask);
> > }
> > ```
> Updated to check the users, I'll do the other simplification separately.
Done in 2db71c9851e5, thanks!


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9186
     ShouldSimplify |= VPlanTransforms::mergeBlocksIntoPredecessors(*Plan);
   }
 
----------------
fhahn wrote:
> Ayal wrote:
> > nit: the above creation and iterative optimization of replicate regions could be folded into some `VPlanTransforms::createAndOptimizeReplicateRegions(*Plan, RecipeBuilder);`
> Will do separately!
Done in eca14a810e59


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143865/new/

https://reviews.llvm.org/D143865



More information about the llvm-commits mailing list