[PATCH] D154644: [LV] Split off code to create initial VPlan (NFC).

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 4 02:52:55 PDT 2023

Ayal accepted this revision.
Ayal added a comment.
This revision is now accepted and ready to land.

This looks good to me, thanks! Adding a couple of final nits.

Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9080
-  VPlanTransforms::removeRedundantCanonicalIVs(*Plan);
-  VPlanTransforms::removeRedundantInductionCasts(*Plan);
-  VPlanTransforms::optimizeInductions(*Plan, *PSE.getSE());
-  VPlanTransforms::removeDeadRecipes(*Plan);
-  VPlanTransforms::createAndOptimizeReplicateRegions(*Plan);
-  VPlanTransforms::removeRedundantExpandSCEVRecipes(*Plan);
-  VPlanTransforms::mergeBlocksIntoPredecessors(*Plan);
-  assert(VPlanVerifier::verifyPlanIsValid(*Plan) && "VPlan is invalid");
-  return std::move(Plan);
+  return Plan;
nit: is replacing `return std::move(Plan)` here with `return Plan` possible independent of all other changes?

Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:416
     // chain and is provided in reverse order, ending with the cast that uses
     // the IV phi. Search for the recipe of the last cast in the chain and
     // replace it with the original IV. Note that only the final cast is
Note: this search works around setting `FindMyCast` directly by retrieving it from `Value2VPValue[IRCast]`, because the latter mapping should be avoided at this time. Perhaps `Casts` should be converted into `CastRecipes` and recorded in `IV` recipe after the latter is built and before `Value2VPValue` is abandoned.

Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:792
+  VPlanTransforms::removeRedundantExpandSCEVRecipes(Plan);
+  VPlanTransforms::mergeBlocksIntoPredecessors(Plan);
nit: do the local calls above need the `VPlanTransforms::` prefix?

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list