Search in sources :

Example 21 with ScheduleResult

use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.

the class MemoryScheduleTest method testIfRead2.

@Test
public void testIfRead2() {
    ScheduleResult schedule = getFinalSchedule("testIfRead2Snippet", TestMode.WITHOUT_FRAMESTATES);
    assertDeepEquals(3, schedule.getCFG().getBlocks().length);
    assertDeepEquals(1, schedule.getCFG().graph.getNodes().filter(FloatingReadNode.class).count());
    assertReadWithinStartBlock(schedule, false);
    assertReadWithinAllReturnBlocks(schedule, false);
    assertReadAndWriteInSameBlock(schedule, false);
}
Also used : ScheduleResult(org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult) Test(org.junit.Test)

Example 22 with ScheduleResult

use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.

the class MemoryScheduleTest method testSplit2.

@Test
public void testSplit2() {
    ScheduleResult schedule = getFinalSchedule("testSplit2Snippet", TestMode.WITHOUT_FRAMESTATES);
    assertReadWithinStartBlock(schedule, false);
    assertReadWithinAllReturnBlocks(schedule, true);
}
Also used : ScheduleResult(org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult) Test(org.junit.Test)

Example 23 with ScheduleResult

use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.

the class MemoryScheduleTest method testAntiDependency.

@Test
public void testAntiDependency() {
    ScheduleResult schedule = getFinalSchedule("testAntiDependencySnippet", TestMode.WITHOUT_FRAMESTATES);
    assertDeepEquals(4, schedule.getCFG().getBlocks().length);
    assertReadBeforeAllWritesInStartBlock(schedule);
}
Also used : ScheduleResult(org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult) Test(org.junit.Test)

Example 24 with ScheduleResult

use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.

the class MemoryScheduleTest method testSplit1.

@Test
public void testSplit1() {
    for (TestMode mode : TestMode.values()) {
        ScheduleResult schedule = getFinalSchedule("testSplit1Snippet", mode);
        assertReadWithinStartBlock(schedule, true);
        assertReadWithinAllReturnBlocks(schedule, false);
    }
}
Also used : ScheduleResult(org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult) Test(org.junit.Test)

Example 25 with ScheduleResult

use of org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult in project graal by oracle.

the class MemoryScheduleTest method testSimple.

@Test
public void testSimple() {
    for (TestMode mode : TestMode.values()) {
        ScheduleResult schedule = getFinalSchedule("testSimpleSnippet", mode);
        StructuredGraph graph = schedule.getCFG().graph;
        assertReadAndWriteInSameBlock(schedule, true);
        assertOrderedAfterSchedule(schedule, graph.getNodes().filter(FloatingReadNode.class).first(), graph.getNodes().filter(WriteNode.class).first());
    }
}
Also used : ScheduleResult(org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult) StructuredGraph(org.graalvm.compiler.nodes.StructuredGraph) Test(org.junit.Test)

Aggregations

ScheduleResult (org.graalvm.compiler.nodes.StructuredGraph.ScheduleResult)38 Test (org.junit.Test)24 Block (org.graalvm.compiler.nodes.cfg.Block)14 Node (org.graalvm.compiler.graph.Node)10 SchedulePhase (org.graalvm.compiler.phases.schedule.SchedulePhase)9 StructuredGraph (org.graalvm.compiler.nodes.StructuredGraph)8 ConstantNode (org.graalvm.compiler.nodes.ConstantNode)6 ValueNode (org.graalvm.compiler.nodes.ValueNode)6 List (java.util.List)5 AbstractMergeNode (org.graalvm.compiler.nodes.AbstractMergeNode)5 FixedWithNextNode (org.graalvm.compiler.nodes.FixedWithNextNode)5 LoopExitNode (org.graalvm.compiler.nodes.LoopExitNode)5 DebugContext (org.graalvm.compiler.debug.DebugContext)4 FixedNode (org.graalvm.compiler.nodes.FixedNode)4 FrameState (org.graalvm.compiler.nodes.FrameState)4 LoopBeginNode (org.graalvm.compiler.nodes.LoopBeginNode)4 ReturnNode (org.graalvm.compiler.nodes.ReturnNode)4 InitializeKlassNode (org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode)3 LoadConstantIndirectlyFixedNode (org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyFixedNode)3 LoadConstantIndirectlyNode (org.graalvm.compiler.hotspot.nodes.aot.LoadConstantIndirectlyNode)3