use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.
the class MemoryScheduleTest method testIfRead3.
@Test
public void testIfRead3() {
ScheduleResult schedule = getFinalSchedule("testIfRead3Snippet", TestMode.WITHOUT_FRAMESTATES);
assertDeepEquals(4, schedule.getCFG().getBlocks().length);
assertReadWithinStartBlock(schedule, false);
assertReadWithinAllReturnBlocks(schedule, true);
}
use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.
the class MemoryScheduleTest method testIfRead4.
@Test
public void testIfRead4() {
ScheduleResult schedule = getFinalSchedule("testIfRead4Snippet", TestMode.WITHOUT_FRAMESTATES);
assertDeepEquals(3, schedule.getCFG().getBlocks().length);
assertReadWithinStartBlock(schedule, false);
assertReadWithinAllReturnBlocks(schedule, false);
assertReadAndWriteInSameBlock(schedule, true);
}
use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.
the class MemoryScheduleTest method testBlockSchedule.
@Test
public void testBlockSchedule() {
ScheduleResult schedule = getFinalSchedule("testBlockScheduleSnippet", TestMode.WITHOUT_FRAMESTATES);
StructuredGraph graph = schedule.getCFG().graph;
NodeIterable<WriteNode> writeNodes = graph.getNodes().filter(WriteNode.class);
assertDeepEquals(1, schedule.getCFG().getBlocks().length);
assertDeepEquals(8, writeNodes.count());
assertDeepEquals(1, graph.getNodes().filter(FloatingReadNode.class).count());
FloatingReadNode read = graph.getNodes().filter(FloatingReadNode.class).first();
WriteNode[] writes = new WriteNode[8];
int i = 0;
for (WriteNode n : writeNodes) {
writes[i] = n;
i++;
}
assertOrderedAfterSchedule(schedule, writes[4], read);
assertOrderedAfterSchedule(schedule, read, writes[5]);
for (int j = 0; j < 7; j++) {
assertOrderedAfterSchedule(schedule, writes[j], writes[j + 1]);
}
}
use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.
the class MemoryScheduleTest method testLoop3.
@Test
public void testLoop3() {
ScheduleResult schedule = getFinalSchedule("testLoop3Snippet", TestMode.WITHOUT_FRAMESTATES);
assertDeepEquals(6, schedule.getCFG().getBlocks().length);
assertReadWithinStartBlock(schedule, true);
assertReadWithinAllReturnBlocks(schedule, false);
}
use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.
the class MemoryScheduleTest method testLoop9.
@Test
public void testLoop9() {
ScheduleResult schedule = getFinalSchedule("testLoop9Snippet", TestMode.WITHOUT_FRAMESTATES);
StructuredGraph graph = schedule.getCFG().getStartBlock().getBeginNode().graph();
assertThat(graph.getNodes(ReturnNode.TYPE), hasCount(1));
ReturnNode ret = graph.getNodes(ReturnNode.TYPE).first();
assertThat(ret.result(), instanceOf(FloatingReadNode.class));
Block readBlock = schedule.getNodeToBlockMap().get(ret.result());
Assert.assertEquals(0, readBlock.getLoopDepth());
}
Aggregations