use of org.graalvm.compiler.nodes.loop.LoopEx in project graal by oracle.
the class PlaceholderLogicNode method explodeLoops.
public static void explodeLoops(final StructuredGraph snippetCopy, CoreProviders providers) {
// Do any required loop explosion
boolean exploded = false;
do {
exploded = false;
ExplodeLoopNode explodeLoop = snippetCopy.getNodes().filter(ExplodeLoopNode.class).first();
if (explodeLoop != null) {
// Earlier canonicalization may have removed the loop
// altogether
LoopBeginNode loopBegin = explodeLoop.findLoopBegin();
if (loopBegin != null) {
LoopEx loop = providers.getLoopsDataProvider().getLoopsData(snippetCopy).loop(loopBegin);
Mark mark = snippetCopy.getMark();
CanonicalizerPhase canonicalizer = CanonicalizerPhase.create();
try {
LoopTransformations.fullUnroll(loop, providers, canonicalizer);
} catch (RetryableBailoutException e) {
// This is a hard error in this context
throw new GraalError(e, snippetCopy.toString());
}
CanonicalizerPhase.create().applyIncremental(snippetCopy, providers, mark, false);
loop.deleteUnusedNodes();
}
GraphUtil.removeFixedWithUnusedInputs(explodeLoop);
exploded = true;
}
} while (exploded);
}
Aggregations