# HG changeset patch # User Thomas Wuerthinger # Date 1363545568 -3600 # Node ID 330b455f18be12648974150c95b88a568c62b7cf # Parent 94f07a009d0ee2e687d73d40289c886795e61785 Make scheduling phase customizable. diff -r 94f07a009d0e -r 330b455f18be graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Sun Mar 17 19:36:10 2013 +0100 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/schedule/SchedulePhase.java Sun Mar 17 19:39:28 2013 +0100 @@ -134,16 +134,23 @@ private BlockMap> blockToNodesMap; private final Map> phantomUsages = new IdentityHashMap<>(); private final Map> phantomInputs = new IdentityHashMap<>(); + private final SchedulingStrategy strategy; + + public SchedulePhase() { + this(GraalOptions.OptScheduleOutOfLoops ? SchedulingStrategy.LATEST_OUT_OF_LOOPS : SchedulingStrategy.LATEST); + } + + public SchedulePhase(SchedulingStrategy strategy) { + this.strategy = strategy; + } @Override protected void run(StructuredGraph graph) { - SchedulingStrategy strategy = GraalOptions.OptScheduleOutOfLoops ? SchedulingStrategy.LATEST_OUT_OF_LOOPS : SchedulingStrategy.LATEST; - cfg = ControlFlowGraph.compute(graph, true, true, true, false); earliestCache = graph.createNodeMap(); blockToNodesMap = new BlockMap<>(cfg); - if (GraalOptions.MemoryAwareScheduling && graph.getNodes(FloatingReadNode.class).isNotEmpty()) { + if (GraalOptions.MemoryAwareScheduling && strategy != SchedulingStrategy.EARLIEST && graph.getNodes(FloatingReadNode.class).isNotEmpty()) { assignBlockToNodes(graph, SchedulingStrategy.EARLIEST); sortNodesWithinBlocks(graph, SchedulingStrategy.EARLIEST);