[LLVMdev] [llvm] r184698 - Add a flag to defer vectorization into a phase after the inliner and its

Chris Lattner clattner at apple.com
Mon Jun 24 15:17:46 PDT 2013


On Jun 24, 2013, at 3:09 PM, Chandler Carruth <chandlerc at gmail.com> wrote:
> The inliner, GVN, and the loop passes run together, *iteratively*. They are neither before or after one another. And this is important as it allows iterative simplification in the inliner. It is one of the most critical optimizations for C++ code that LLVM does.
> 
> We can't sink all of the loop passes out of the iterative pass model either, because deleting loops, simplifying them, etc. all directly feed the iterative simplification needed by GVN and the inliner.
> 
> We need a *second* loop pass that happens after the iterative CGSCC walk which does the further optimizations such as (potentially indvars, ) the vectorizers, LSR, lower-switch, CGP, CG. I think we actually want most of the post CGSCC module passes to run after the vectorizers and before LSR to fold away constants and globals that look different after vectorization compared to before, but aren't significantly shifted by LSR and CGP.

In terms of mental model, is it best to think of vectorization as being a loop pass or as a late lowering pass?

What about when we get more aggressive loop transformations like blocking, strip mining, fusion, etc? 

-Chris




More information about the llvm-dev mailing list