[PATCH] [LoopInterchange] Add support to interchange loops with reductions.

Renato Golin renato.golin at linaro.org
Fri Mar 13 11:20:28 PDT 2015


On 13 March 2015 at 17:50, Karthik Bhat <kv.bhat at samsung.com> wrote:
> Since this is a complete pass integrating this will loop vectorizer would be a bit difficult.  I can try to move common functions into a utility file if required.

I worry more about the duplication of code that the other bits below...


>> 1. Move a lot of internal methods to static. This could be ok, but needs some further explanation why it is so.
> These methods are helper functions. Helper functions are usually marked static in other Passes i had missed it in my initial commit hence corrected it here.

Sorry, I saw the new methods down there and assumed those were class
members, not utility functions. You're quite right.


>> 2. Move the interchange pass down the pipeline. Again, it could be the right thing to do, but also needs some context.
> I had to move interchange pass down the pipeline and add licm and loop unswitch pass after loop interchange as after the inner loop header/loop latches are split and loops are interchanged we get multiple blocks with successors outside the loop(i.e. getExitingBlock was null). This kind of loop is not handled by vectorize and hence had to run licm and loop unswitch to remove unconditional branches between blocks in the inner loop.

Right, and the original change is quite recent, so not much could be
broken by this big change.


> I have run llvm lnt test cases but unfortunately didn't observe much improvement with this patch. I'm planning to run phoronix test suites to see if it gives improvement in some known benchmark. The matrix multiplication code was from one of our internal test cases which showed improvement post this patch. Have added few test cases (positive and negative) and ran make check all to make sure there are no regression. Also have written few local C test cases to check that the o/p's are same after interchange.

That's great, thanks!

cheers,
--renato




More information about the llvm-commits mailing list