Loop interchange pass is added to libScalarOpts.a 1. Copy LoopInterchange.cpp to lib/Transform/Scalar directory 2. Add the following line in include/llvm/Transforms/Scalar.h file Pass *createLoopInterchangePass(); 3. Add the following line to /include/llvm/Support/StandardPasses.h in llvm namespace. PM->add(createLoopInterchangePass()); 4. Run make in the Scalar directory and run make in the tools/opt directory. The command line option is -loop-interchange. $opt -lcssa -loop-interchange sum.bc -o sum_new.bc Currently this pass only works with the input with loops in simplified form. i.e. The loop header is not an exiting node.The loop should have only one exiting node. The attached files are 1. LoopInterchange.cpp 2. sum.c, a test case which sums up all the a numbers in a two dimensional array 3. t.c, a test case which prints an array row-wise. i.e. it prints each element one by one, row after row. This version does not use data dependence analysis to check if the transformation is legal or not. To test the code with foo.c please run the following commands: 1. $llvm-gcc -O3 -emit-llvm foo.c 2. $opt -lcssa -loopsimplify -loop-interchange foo.bc -o bar.bc 4. lli bar.bc check the output.