public class LoopConditionUnroller
extends BodyTransformer
"unrolls" the condition of while/for loops.
before the first test of a while-loop, we can't be sure, if the body will be
taken or not, and several optimizations (especially LCM) can't be done. In
this class we try to solve this problem by unrolling the condition of the
while-block: we make a copy of the condition-block, and redirect the
back-edge of the while-loop to the new block.
After this transformation the edge between the original condition-block and
the loop-body is only executed once (and hence suitable for LCM) and we can
be sure, that the loop-body will get executed.
Exceptions are ignored (the transformation is done on a
BriefBlockGraph
.