[PATCH] D111300: [VPlan] Keep induction recipes in header.
Ayal Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 25 13:19:06 PDT 2021
Ayal added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9333
RecipeBuilder.setRecipe(Instr, Recipe);
+ if (isa<VPWidenIntOrFpInductionRecipe>(Recipe)) {
----------------
Worth a comment why VPWidenIntOrFpInductionRecipe deserves special displacement.
(Easiest to handle here; just raising some related thoughts:
This is somewhat reminiscent of SinkAfter, in that recipes created next to their triggering ingredient need to be placed elsewhere; but SinkAfter is quite cumbersome. Other conceptual approaches may be to search for Trunc's when processing an IV Phi and produce a recipe for each (but current scheme produces a single recipe per triggering ingredient), and first hoisting the Trunc to appear in the header (i.e., cleaning up SinkAfter - perhaps once VPlan starts by representing the original scalar loop).)
================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:9339
+ else
+ Header->appendRecipe(Recipe);
+ } else
----------------
Suffice to have `Header->insert(Recipe, Header->getFirstNonPhi())` for both cases?
May be worth wrapping within an insertPhi() method.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111300/new/
https://reviews.llvm.org/D111300
More information about the llvm-commits
mailing list