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

Karthik Bhat kv.bhat at samsung.com
Tue Mar 17 01:48:25 PDT 2015

Hi Hal,Renato,
Refactor some common code into functions. I have currently borrowed and modified some functions from loop vectorizer. Do i need to refactor them into a common utility as well? These functions such as AddReductionVar seems to be a bit tightly bound with loop vectorizer code.

Second change is in PassManagerBuilder. Running SimplifyCFGPass after LoopInterchange is sufficient to merge and remove redundant basic blocks(blocks with just unconditional branch)  produced after loop interhcange.Update the code to reflect the same.

I ran few phoronix benchmarks and lnt benchamrks but unfortunetly didn't see any improvement/regression due to this patch.

As mentioned in previous comments post this change code such as-

  void matrixMult(int N, int M, int K) {
    for(int i=0;i<N;i++)
      for(int j=0;j<M;j++)
        for(int k=0;k<K;k++)

gets vectorized givinig some execution time improvement during large matrix multiplication.

Please if you could let me know your inputs on the same. 
Also are there are matrix multiplication benchark which i can test to see if the kind of code i mentioned above gets triggered?

Thanks and Regards
Karthik Bhat



-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8314.22080.patch
Type: text/x-patch
Size: 42078 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150317/b82fb5fb/attachment.bin>

More information about the llvm-commits mailing list