llvm-6502/include/llvm/Transforms
Karthik Bhat 52610d84ad Add a new pass "Loop Interchange"
This pass interchanges loops to provide a more cache-friendly memory access.

For e.g. given a loop like -
  for(int i=0;i<N;i++)
    for(int j=0;j<N;j++)
      A[j][i] = A[j][i]+B[j][i];

is interchanged to -
  for(int j=0;j<N;j++)
    for(int i=0;i<N;i++)
      A[j][i] = A[j][i]+B[j][i];

This pass is currently disabled by default.

To give a brief introduction it consists of 3 stages-

LoopInterchangeLegality : Checks the legality of loop interchange based on Dependency matrix.
LoopInterchangeProfitability: A very basic heuristic has been added to check for profitibility. This will evolve over time.
LoopInterchangeTransform : Which does the actual transform.

LNT Performance tests shows improvement in Polybench/linear-algebra/kernels/mvt and Polybench/linear-algebra/kernels/gemver becnmarks.

TODO:
1) Add support for reductions and lcssa phi.
2) Improve profitability model.
3) Improve loop selection algorithm to select best loop for interchange. Currently the innermost loop is selected for interchange.
4) Improve compile time regression found in llvm lnt due to this pass.
5) Fix issues in Dependency Analysis module.

A special thanks to Hal for reviewing this code.
Review: http://reviews.llvm.org/D7499




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231458 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-06 10:11:25 +00:00
..
InstCombine Removing LLVM_DELETED_FUNCTION, as MSVC 2012 was the last reason for requiring the macro. NFC; LLVM edition. 2015-02-15 22:54:22 +00:00
IPO LowerBitSets: Use byte arrays instead of bit sets to represent in-memory bit sets. 2015-03-03 00:49:28 +00:00
Scalar [PM] Clean up a stale comment that came from a differnt pass when 2015-02-01 11:35:56 +00:00
Utils Make DataLayout Non-Optional in the Module 2015-03-04 18:43:29 +00:00
Instrumentation.h Add missing include. 2015-02-04 18:16:53 +00:00
IPO.h Introduce bitset metadata format and bitset lowering pass. 2015-02-20 20:30:47 +00:00
ObjCARC.h Reformat linefeeds. 2014-05-26 00:25:26 +00:00
Scalar.h Add a new pass "Loop Interchange" 2015-03-06 10:11:25 +00:00
Vectorize.h Allow vectorization of bit intrinsics in BB Vectorizer. 2014-04-25 03:33:48 +00:00