Nested Loop Unrolling


In LLVM (using the opt tool), is it possible to force a nested loop be unrolled entirely? Something like a pass option?
I have a nested loop with depth of 4, and all trip counts are known at compile time, but so far I've only been able to do this by 4 invocations of the -loop-simplify, -loop-rotate, -loop-unroll passes.


This has to do with the order that the LoopUnrollPass is applied to the loops. The unroll pass itself wouldn’t be able to control it.

The loop tree should be processed bottom-up, so nested loops should be fully unrolled. If you’re not seeing that for an obvious case, please file a bug.