22 */ |
22 */ |
23 |
23 |
24 |
24 |
25 package org.graalvm.compiler.core.phases; |
25 package org.graalvm.compiler.core.phases; |
26 |
26 |
27 import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; |
|
28 |
|
29 import org.graalvm.compiler.nodes.spi.LoweringTool; |
27 import org.graalvm.compiler.nodes.spi.LoweringTool; |
30 import org.graalvm.compiler.options.OptionValues; |
28 import org.graalvm.compiler.options.OptionValues; |
31 import org.graalvm.compiler.phases.PhaseSuite; |
|
32 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
29 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
33 import org.graalvm.compiler.phases.common.ExpandLogicPhase; |
30 import org.graalvm.compiler.phases.common.ExpandLogicPhase; |
34 import org.graalvm.compiler.phases.common.LoweringPhase; |
31 import org.graalvm.compiler.phases.common.LoweringPhase; |
35 import org.graalvm.compiler.phases.schedule.SchedulePhase; |
32 import org.graalvm.compiler.phases.schedule.SchedulePhase; |
36 import org.graalvm.compiler.phases.tiers.LowTierContext; |
33 import org.graalvm.compiler.phases.tiers.LowTierContext; |
37 |
34 |
38 public class EconomyLowTier extends PhaseSuite<LowTierContext> { |
35 public class EconomyLowTier extends BaseTier<LowTierContext> { |
39 |
36 |
40 public EconomyLowTier(OptionValues options) { |
37 public EconomyLowTier(OptionValues options) { |
41 CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); |
38 CanonicalizerPhase canonicalizer = this.createCanonicalizerPhase(options); |
42 if (ImmutableCode.getValue(options)) { |
|
43 canonicalizer.disableReadCanonicalization(); |
|
44 } |
|
45 |
|
46 appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.LOW_TIER)); |
39 appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.LOW_TIER)); |
47 |
|
48 appendPhase(new ExpandLogicPhase()); |
40 appendPhase(new ExpandLogicPhase()); |
49 |
|
50 appendPhase(new SchedulePhase(SchedulePhase.SchedulingStrategy.LATEST_OUT_OF_LOOPS)); |
41 appendPhase(new SchedulePhase(SchedulePhase.SchedulingStrategy.LATEST_OUT_OF_LOOPS)); |
51 } |
42 } |
52 } |
43 } |