LoopInterchange Pass


I developed a Loop Interchange pass. Please take a look.
I have not incorporate data dependence analysis check. I can insert it when the LoopDependenceAnalysis is available.

Thank you

LoopInterchange.cpp (19.3 KB)


The following two lines scare me:

// TODO Perform data dependence analysis for the loop nest.
// TODO Check if there is any data dependence preventing interchange.

It looks like your pass is going ahead and interchanging pairs of loops, without checking for correctness concerns. Is this the case? Have you tested it on, say, the LLVM nightly testsuite?