use of org.graalvm.compiler.nodes.memory.WriteNode 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.memory.WriteNode in project graal by oracle.
the class MemoryScheduleTest method assertReadAndWriteInSameBlock.
private static void assertReadAndWriteInSameBlock(ScheduleResult schedule, boolean inSame) {
StructuredGraph graph = schedule.getCFG().graph;
FloatingReadNode read = graph.getNodes().filter(FloatingReadNode.class).first();
WriteNode write = graph.getNodes().filter(WriteNode.class).first();
assertTrue(!(inSame ^ schedule.getCFG().blockFor(read) == schedule.getCFG().blockFor(write)));
}
Aggregations