Mercurial > hg > truffle
annotate graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/MidTier.java @ 13378:16d99e9d77ad
Options: rename flag (AOTCompilation -> ImmutableCode)
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 18 Dec 2013 11:13:17 +0100 |
parents | 3a05ef752a40 |
children | 75a67ebd50e8 |
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.*; |
9137 | 28 import com.oracle.graal.phases.*; |
29 import com.oracle.graal.phases.common.*; | |
30 import com.oracle.graal.phases.tiers.*; | |
10814
8b0c8fbbfa1c
make early read elimination work on read/write nodes (in addition to load/store)
Lukas Stadler <lukas.stadler@jku.at>
parents:
10807
diff
changeset
|
31 import com.oracle.graal.virtual.phases.ea.*; |
9137 | 32 |
33 public class MidTier extends PhaseSuite<MidTierContext> { | |
34 | |
35 public MidTier() { | |
13378
16d99e9d77ad
Options: rename flag (AOTCompilation -> ImmutableCode)
Bernhard Urban <bernhard.urban@jku.at>
parents:
13129
diff
changeset
|
36 CanonicalizerPhase canonicalizer = new CanonicalizerPhase(!ImmutableCode.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 | |
10807
d3a677910eea
new ValueAnchorCleanupPhase to make lock elimination work again, tests for lock elimination
Lukas Stadler <lukas.stadler@jku.at>
parents:
10806
diff
changeset
|
45 appendPhase(new ValueAnchorCleanupPhase()); |
10806
f272fe8a2f9a
move LockElimination to MidTier
Lukas Stadler <lukas.stadler@jku.at>
parents:
10805
diff
changeset
|
46 appendPhase(new LockEliminationPhase()); |
f272fe8a2f9a
move LockElimination to MidTier
Lukas Stadler <lukas.stadler@jku.at>
parents:
10805
diff
changeset
|
47 |
10814
8b0c8fbbfa1c
make early read elimination work on read/write nodes (in addition to load/store)
Lukas Stadler <lukas.stadler@jku.at>
parents:
10807
diff
changeset
|
48 if (OptReadElimination.getValue()) { |
11571
5bbc028f4507
Pass canonicalizer into EffectsPhase.
Roland Schatz <roland.schatz@oracle.com>
parents:
11566
diff
changeset
|
49 appendPhase(new EarlyReadEliminationPhase(canonicalizer)); |
10814
8b0c8fbbfa1c
make early read elimination work on read/write nodes (in addition to load/store)
Lukas Stadler <lukas.stadler@jku.at>
parents:
10807
diff
changeset
|
50 } |
8b0c8fbbfa1c
make early read elimination work on read/write nodes (in addition to load/store)
Lukas Stadler <lukas.stadler@jku.at>
parents:
10807
diff
changeset
|
51 |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
52 if (OptFloatingReads.getValue()) { |
11566
aa9ce8d56771
New methods for incremental canonicalization.
Roland Schatz <roland.schatz@oracle.com>
parents:
11437
diff
changeset
|
53 IncrementalCanonicalizerPhase<MidTierContext> incCanonicalizer = new IncrementalCanonicalizerPhase<>(canonicalizer); |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
54 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
|
55 appendPhase(incCanonicalizer); |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
56 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
|
57 appendPhase(new ReadEliminationPhase()); |
9137 | 58 } |
59 } | |
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 RemoveValueProxyPhase()); |
9137 | 61 |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
62 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
|
63 appendPhase(canonicalizer); |
9137 | 64 } |
65 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
66 if (OptEliminatePartiallyRedundantGuards.getValue()) { |
12481
45daf0d65522
Replace EliminatePartiallyRedundantGuardsPhase with OptimizeGuardAnchors
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
67 appendPhase(new OptimizeGuardAnchors()); |
9137 | 68 } |
69 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
70 if (ConditionalElimination.getValue() && OptCanonicalizer.getValue()) { |
11574
50577f991923
Pass canonicalizer into IterativeConditionalEliminationPhase.
Roland Schatz <roland.schatz@oracle.com>
parents:
11571
diff
changeset
|
71 appendPhase(new IterativeConditionalEliminationPhase(canonicalizer)); |
9137 | 72 } |
73 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
74 if (OptEliminatePartiallyRedundantGuards.getValue()) { |
12481
45daf0d65522
Replace EliminatePartiallyRedundantGuardsPhase with OptimizeGuardAnchors
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11760
diff
changeset
|
75 appendPhase(new OptimizeGuardAnchors()); |
9137 | 76 } |
77 | |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
78 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
|
79 appendPhase(canonicalizer); |
9137 | 80 } |
9271
7409a84b6001
Move more phases into tiers.
Roland Schatz <roland.schatz@oracle.com>
parents:
9143
diff
changeset
|
81 |
10029
839791e70ff1
Method for adding a new phase at the beginning of a suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
10009
diff
changeset
|
82 appendPhase(new LoopSafepointEliminationPhase()); |
9511
715f82d1f695
Enable the loop safepoint elimination.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
9271
diff
changeset
|
83 |
11760
ce0b00597980
made safepoint-on-return use specialized HotSpot runtime support for such safepoints (which have no debug info attached)
Doug Simon <doug.simon@oracle.com>
parents:
11725
diff
changeset
|
84 appendPhase(new LoopSafepointInsertionPhase()); |
9271
7409a84b6001
Move more phases into tiers.
Roland Schatz <roland.schatz@oracle.com>
parents:
9143
diff
changeset
|
85 |
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(new GuardLoweringPhase()); |
9679
661dfb29b59b
Do a full canonicalization at the end of MidTier.
Roland Schatz <roland.schatz@oracle.com>
parents:
9511
diff
changeset
|
87 |
11584 | 88 appendPhase(new LoweringPhase(canonicalizer)); |
10671
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
89 |
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
90 appendPhase(new FrameStateAssignmentPhase()); |
69089865435a
New lowering phase after framestate assignment.
Roland Schatz <roland.schatz@oracle.com>
parents:
10029
diff
changeset
|
91 |
13129
3a05ef752a40
Introduce option to disable deoptimization grouping
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12481
diff
changeset
|
92 if (OptDeoptimizationGrouping.getValue()) { |
3a05ef752a40
Introduce option to disable deoptimization grouping
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12481
diff
changeset
|
93 appendPhase(new DeoptimizationGroupingPhase()); |
3a05ef752a40
Introduce option to disable deoptimization grouping
Christian Wimmer <christian.wimmer@oracle.com>
parents:
12481
diff
changeset
|
94 } |
11725
45570e4fe8a9
Group Deoptimization which have the same FrameState
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
11584
diff
changeset
|
95 |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9679
diff
changeset
|
96 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
|
97 appendPhase(canonicalizer); |
9679
661dfb29b59b
Do a full canonicalization at the end of MidTier.
Roland Schatz <roland.schatz@oracle.com>
parents:
9511
diff
changeset
|
98 } |
9137 | 99 } |
100 } |