use of org.graalvm.compiler.replacements.nodes.ExplodeLoopNode in project graal by oracle.
the class SnippetTemplate method explodeLoops.
public static void explodeLoops(final StructuredGraph snippetCopy, PhaseContext phaseContext) {
// 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 = new LoopsData(snippetCopy).loop(loopBegin);
Mark mark = snippetCopy.getMark();
LoopTransformations.fullUnroll(loop, phaseContext, new CanonicalizerPhase());
new CanonicalizerPhase().applyIncremental(snippetCopy, phaseContext, mark);
loop.deleteUnusedNodes();
}
GraphUtil.removeFixedWithUnusedInputs(explodeLoop);
exploded = true;
}
} while (exploded);
}
Aggregations