So if I'm understanding this, this only works for loops with a finite number of iterations knowable at compile time, right?
I haven't looked at the exact criteria in this transformation, but it's very likely that there are also a couple of constraints on how precisely the loop is structured.