src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
equal
deleted
inserted
replaced
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 package org.graalvm.compiler.microbenchmarks.graal.util; |
23 package org.graalvm.compiler.microbenchmarks.graal.util; |
24 |
24 |
|
25 import org.graalvm.compiler.nodes.StructuredGraph; |
|
26 import org.graalvm.compiler.phases.OptimisticOptimizations; |
|
27 import org.graalvm.compiler.phases.PhaseSuite; |
25 import org.graalvm.compiler.phases.schedule.SchedulePhase; |
28 import org.graalvm.compiler.phases.schedule.SchedulePhase; |
26 import org.graalvm.compiler.phases.schedule.SchedulePhase.SchedulingStrategy; |
29 import org.graalvm.compiler.phases.schedule.SchedulePhase.SchedulingStrategy; |
|
30 import org.graalvm.compiler.phases.tiers.HighTierContext; |
27 |
31 |
28 public class ScheduleState extends GraphState { |
32 public class ScheduleState extends GraphState { |
29 |
33 |
30 public SchedulePhase schedule; |
34 public SchedulePhase schedule; |
31 |
35 |
34 public ScheduleState(SchedulingStrategy selectedStrategy) { |
38 public ScheduleState(SchedulingStrategy selectedStrategy) { |
35 this.selectedStrategy = selectedStrategy; |
39 this.selectedStrategy = selectedStrategy; |
36 } |
40 } |
37 |
41 |
38 public ScheduleState() { |
42 public ScheduleState() { |
39 this(SchedulingStrategy.EARLIEST); |
43 this(SchedulingStrategy.EARLIEST_WITH_GUARD_ORDER); |
40 } |
44 } |
41 |
45 |
42 @Override |
46 @Override |
43 public void beforeInvocation() { |
47 public void beforeInvocation() { |
44 schedule = new SchedulePhase(selectedStrategy); |
48 schedule = new SchedulePhase(selectedStrategy); |
45 super.beforeInvocation(); |
49 super.beforeInvocation(); |
46 } |
50 } |
|
51 |
|
52 @Override |
|
53 protected StructuredGraph preprocessOriginal(StructuredGraph structuredGraph) { |
|
54 StructuredGraph g = super.preprocessOriginal(structuredGraph); |
|
55 GraalState graal = new GraalState(); |
|
56 PhaseSuite<HighTierContext> highTier = graal.backend.getSuites().getDefaultSuites(graal.options).getHighTier(); |
|
57 highTier.apply(g, new HighTierContext(graal.providers, graal.backend.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL)); |
|
58 return g; |
|
59 } |
47 } |
60 } |