[PATCH] D32200: [LV] Refactor ILV.vectorize[Loop]() by introducing LVP.executePlan()

Ayal Zaks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 10:08:03 PDT 2017


Ayal added inline comments.


================
Comment at: lib/Transforms/Vectorize/LoopVectorize.cpp:395
+  /// Create a new empty loop. Unlink the old loop and connect the new one.
+  void createEmptyLoop();
+
----------------
mssimpso wrote:
> mkuper wrote:
> > The public interface this ends up exposing is pretty weird, but I don't have any good ideas.
> > Matt, what do you think?
> I see what you mean, but I also don't have any real suggestions. Something like LV.vectorizeLoop(LVP.getBestVPlan()) might be more straightforward than LVP.executePlan(). But I'm not sure how such a change would affect the refactoring plans.
ILV.createEmptyLoop() should indeed better be renamed ILV.createVectorizedLoop().

The refactoring plans aim to employ ILV for code-generation services, such as vectorizeInstruction(), driven by VPlan.transform() via its Recipes. Similarly to later employing CM for cost-model services by VPlan.expectedCost(), thereby aligning the two. Invoking VPlan.transform() on the best VPlan should eventually take care of all code generation. Before having VPlan in place, covering all code generation, this patch proposes to have LVP.executePlan() take care of it.

collectTriviallyDeadInstructions() is moved to LVP, and will later serve it to construct VPlans; in this patch it serves LVP to generate the code.


https://reviews.llvm.org/D32200





More information about the llvm-commits mailing list