Mercurial > hg > truffle
annotate graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java @ 10805:842166781ddb
always perform canonicalization at the beginning of MidTier
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 18 Jul 2013 13:15:07 +0200 |
parents | 69089865435a |
children | f272fe8a2f9a |
rev | line source |
---|---|
9137 | 1 /* |
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.oracle.graal.compiler.phases; | |
24 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
25 import static com.oracle.graal.phases.GraalOptions.*; |
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
26 |
9511
715f82d1f695
Enable the loop safepoint elimination.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9271
diff
changeset
|
27 import com.oracle.graal.loop.phases.*; |
10671
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
28 import com.oracle.graal.nodes.spi.Lowerable.LoweringType; |
9137 | 29 import com.oracle.graal.phases.*; |
30 import com.oracle.graal.phases.common.*; | |
31 import com.oracle.graal.phases.tiers.*; | |
32 | |
33 public class MidTier extends PhaseSuite<MidTierContext> { | |
34 | |
35 public MidTier() { | |
10009
b5c87b5c6e9c
add option to enable ahead of time compilation for hotspot (GRAAL-290)
Bernhard Urban <bernhard.urban@jku.at>
parents:
9916
diff
changeset
|
36 CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!AOTCompilation.getValue()); |
9916
491cd7d69539
CanonicalizerPhase: remove it from context, add it to tiers instead and configure/pass it there (GRAAL-309)
Bernhard Urban <bernhard.urban@jku.at>
parents:
9907
diff
changeset
|
37 |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
38 if (OptPushThroughPi.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
39 appendPhase(new PushThroughPiPhase()); |
10805
842166781ddb
always perform canonicalization at the beginning of MidTier
Lukas Stadler <lukas.stadler@jku.at>
parents:
10671
diff
changeset
|
40 } |
842166781ddb
always perform canonicalization at the beginning of MidTier
Lukas Stadler <lukas.stadler@jku.at>
parents:
10671
diff
changeset
|
41 if (OptCanonicalizer.getValue()) { |
842166781ddb
always perform canonicalization at the beginning of MidTier
Lukas Stadler <lukas.stadler@jku.at>
parents:
10671
diff
changeset
|
42 appendPhase(canonicalizer); |
9137 | 43 } |
44 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
45 if (OptFloatingReads.getValue()) { |
9916
491cd7d69539
CanonicalizerPhase: remove it from context, add it to tiers instead and configure/pass it there (GRAAL-309)
Bernhard Urban <bernhard.urban@jku.at>
parents:
9907
diff
changeset
|
46 IncrementalCanonicalizerPhase<MidTierContext> incCanonicalizer = new IncrementalCanonicalizerPhase<>(); |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
47 incCanonicalizer.appendPhase(new FloatingReadPhase()); |
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
48 appendPhase(incCanonicalizer); |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
49 if (OptReadElimination.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
50 appendPhase(new ReadEliminationPhase()); |
9137 | 51 } |
52 } | |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
53 appendPhase(new RemoveValueProxyPhase()); |
9137 | 54 |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
55 if (OptCanonicalizer.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
56 appendPhase(canonicalizer); |
9137 | 57 } |
58 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
59 if (OptEliminatePartiallyRedundantGuards.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
60 appendPhase(new EliminatePartiallyRedundantGuardsPhase(false, true)); |
9137 | 61 } |
62 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
63 if (ConditionalElimination.getValue() && OptCanonicalizer.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
64 appendPhase(new IterativeConditionalEliminationPhase()); |
9137 | 65 } |
66 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
67 if (OptEliminatePartiallyRedundantGuards.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
68 appendPhase(new EliminatePartiallyRedundantGuardsPhase(true, true)); |
9137 | 69 } |
70 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
71 if (OptCanonicalizer.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
72 appendPhase(canonicalizer); |
9137 | 73 } |
9271
7409a84b6001
Move more phases into tiers.
Roland Schatz <roland.schatz@oracle.com>
parents:
9143
diff
changeset
|
74 |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
75 appendPhase(new LoopSafepointEliminationPhase()); |
9511
715f82d1f695
Enable the loop safepoint elimination.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9271
diff
changeset
|
76 |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
77 appendPhase(new SafepointInsertionPhase()); |
9271
7409a84b6001
Move more phases into tiers.
Roland Schatz <roland.schatz@oracle.com>
parents:
9143
diff
changeset
|
78 |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
79 appendPhase(new GuardLoweringPhase()); |
9679
661dfb29b59b
Do a full canonicalization at the end of MidTier.
Roland Schatz <roland.schatz@oracle.com>
parents:
9511
diff
changeset
|
80 |
10671
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
81 appendPhase(new LoweringPhase(LoweringType.AFTER_GUARDS)); |
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
82 |
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
83 appendPhase(new FrameStateAssignmentPhase()); |
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
84 |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
85 if (OptCanonicalizer.getValue()) { |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
86 appendPhase(canonicalizer); |
9679
661dfb29b59b
Do a full canonicalization at the end of MidTier.
Roland Schatz <roland.schatz@oracle.com>
parents:
9511
diff
changeset
|
87 } |
9137 | 88 } |
89 } |