use of org.graalvm.compiler.graph.iterators.NodePredicate in project graal by oracle.
the class LoopPhiCanonicalizerTest method test.
@Test
public void test() {
StructuredGraph graph = parseEager("loopSnippet", AllowAssumptions.YES);
NodePredicate loopPhis = node -> node instanceof PhiNode && ((PhiNode) node).merge() instanceof LoopBeginNode;
PhaseContext context = new PhaseContext(getProviders());
Assert.assertEquals(5, graph.getNodes().filter(loopPhis).count());
new CanonicalizerPhase().apply(graph, context);
Assert.assertEquals(2, graph.getNodes().filter(loopPhis).count());
test("loopSnippet");
}
Aggregations