# HG changeset patch # User Bernhard Urban # Date 1370503562 -7200 # Node ID 7e0a3f8fbd70b30d156344f975b5a850abc78996 # Parent fc93d919f896116f0d607df4532dc88e935c9710 CanonicalizerPhase: add phase that obtains the canonicalizer from the context diff -r fc93d919f896 -r 7e0a3f8fbd70 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/HighTier.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/HighTier.java Wed Jun 05 21:17:38 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/HighTier.java Thu Jun 06 09:26:02 2013 +0200 @@ -63,7 +63,7 @@ } if (OptCanonicalizer.getValue()) { - addPhase(new CanonicalizerPhase()); + addPhase(new CanonicalizerPhase.Context()); } addPhase(new LoweringPhase(LoweringType.BEFORE_GUARDS)); diff -r fc93d919f896 -r 7e0a3f8fbd70 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java Wed Jun 05 21:17:38 2013 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java Thu Jun 06 09:26:02 2013 +0200 @@ -35,7 +35,7 @@ if (OptPushThroughPi.getValue()) { addPhase(new PushThroughPiPhase()); if (OptCanonicalizer.getValue()) { - addPhase(new CanonicalizerPhase()); + addPhase(new CanonicalizerPhase.Context()); } } @@ -50,7 +50,7 @@ addPhase(new RemoveValueProxyPhase()); if (OptCanonicalizer.getValue()) { - addPhase(new CanonicalizerPhase()); + addPhase(new CanonicalizerPhase.Context()); } if (OptEliminatePartiallyRedundantGuards.getValue()) { @@ -66,7 +66,7 @@ } if (OptCanonicalizer.getValue()) { - addPhase(new CanonicalizerPhase()); + addPhase(new CanonicalizerPhase.Context()); } addPhase(new LoopSafepointEliminationPhase()); @@ -76,7 +76,7 @@ addPhase(new GuardLoweringPhase()); if (OptCanonicalizer.getValue()) { - addPhase(new CanonicalizerPhase()); + addPhase(new CanonicalizerPhase.Context()); } } } diff -r fc93d919f896 -r 7e0a3f8fbd70 graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java --- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Wed Jun 05 21:17:38 2013 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/CanonicalizerPhase.java Thu Jun 06 09:26:02 2013 +0200 @@ -344,4 +344,12 @@ } } } + + public static class Context extends BasePhase { + + @Override + protected void run(StructuredGraph graph, PhaseContext context) { + context.applyCanonicalizer(graph); + } + } }