[PATCH] D118051: [VPlan] Remove dead header-phi recipes.

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 20 14:28:21 PST 2022


Ayal added a comment.

minor nits



================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:303
 
-    // Visit all casts connected to IV and in Casts. Collect them.
-    // remember them for removal.
+    // A sequence of IR Casts has potentially been recorded for IV, which need
+    // to be bypassed when the IV is vectorized, because the vectorized IV will
----------------
Worth emphasizing "need to be" - unlike other VPlanTransforms/VPlan2VPlan optimizations, this optimization is mandatory.
Perhaps better call it "removeObsoleteInductionCasts()"? (comment is indep. of this patch)


================
Comment at: llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp:367
+  // TODO: Remove dead recipes across whole plan.
+  for (VPRecipeBase &R : make_early_inc_range(reverse(*Header))) {
+    if (R.mayHaveSideEffects() ||
----------------
fhahn wrote:
> Ayal wrote:
> > reverse is needed in order to collect dead chains/DAGs, right?
> Yes, it allows us to catch chains of dead recipes.
That may be worth pointing out.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118051



More information about the llvm-commits mailing list