[LLVMdev] How to unroll loops in opposite loop nest order

Martin Apel martin.apel at SIMPACK.de
Tue Jun 5 03:20:48 PDT 2012


I am trying to implement loop unrolling in a context, where lots of
constant propagation has taken place.
Unrolling an outer loop might make an inner loop have constant bounds,
therefore I want to process the loops
outside in, i.e. from parent loops to nested loops.
Unfortunately the standard loop pass manager performs loop passes inside
out, i.e. from nested loops to parent loops,
thereby missing optimization opportunities in my case.

I haven't found a way how to implement this on my own. I tried
implementing a function pass, where I could process the
loops outside in. Unfortunately I cannot use the UnrollLoop utility
function in this case, which crashes, when called with a
NULL LPPassManager object, despite opposite documentation.

Is there any way how to process loops outside in still using the
UnrollLoop function?

Martin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120605/8d943358/attachment.html>


More information about the llvm-dev mailing list