Mercurial > hg > graal-compiler
annotate graal/GraalCompiler/src/com/sun/c1x/opt/PhiSimplifier.java @ 2695:785e9ecdcc69
Removed the instruction substitutor.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 18 May 2011 15:03:45 +0200 |
parents | 768d77a1c7af |
children | c1ce2a53d6c3 |
rev | line source |
---|---|
2532
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
1 /* |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
2 * Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
4 * |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
8 * |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
13 * accompanied this code). |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
14 * |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
18 * |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
21 * questions. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
22 */ |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
23 package com.sun.c1x.opt; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
24 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
25 import com.sun.c1x.graph.IR; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
26 import com.sun.c1x.ir.*; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
27 import com.sun.c1x.value.*; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
28 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
29 /** |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
30 * The {@code PhiSimplifier} class is a helper class that can reduce phi instructions. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
31 * |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
32 * @author Ben L. Titzer |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
33 */ |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
34 public final class PhiSimplifier implements BlockClosure { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
35 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
36 final IR ir; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
37 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
38 public PhiSimplifier(IR ir) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
39 this.ir = ir; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
40 ir.startBlock.iterateAnyOrder(this, false); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
41 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
42 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
43 /** |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
44 * This method is called for each block and processes any phi statements in the block. |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
45 * @param block the block to apply the simplification to |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
46 */ |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
47 public void apply(BlockBegin block) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
48 FrameState state = block.stateBefore(); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
49 for (int i = 0; i < state.stackSize(); i++) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
50 simplify(state.stackAt(i)); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
51 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
52 for (int i = 0; i < state.localsSize(); i++) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
53 simplify(state.localAt(i)); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
54 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
55 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
56 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
57 Value simplify(Value x) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
58 if (x == null || !(x instanceof Phi)) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
59 return x; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
60 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
61 Phi phi = (Phi) x; |
2695
785e9ecdcc69
Removed the instruction substitutor.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
2582
diff
changeset
|
62 if (phi.checkFlag(Value.Flag.PhiCannotSimplify)) { |
2532
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
63 // already tried, cannot simplify this phi |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
64 return phi; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
65 } else if (phi.checkFlag(Value.Flag.PhiVisited)) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
66 // break cycles in phis |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
67 return phi; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
68 } else if (phi.isIllegal()) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
69 // don't bother with illegals |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
70 return phi; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
71 } else { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
72 // attempt to simplify the phi by recursively simplifying its operands |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
73 phi.setFlag(Value.Flag.PhiVisited); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
74 Value phiSubst = null; |
2582
768d77a1c7af
new node layout: Instruction
Lukas Stadler <lukas.stadler@jku.at>
parents:
2532
diff
changeset
|
75 int max = phi.phiInputCount(); |
2532
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
76 boolean cannotSimplify = false; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
77 for (int i = 0; i < max; i++) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
78 Value oldInstr = phi.inputAt(i); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
79 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
80 if (oldInstr == null || oldInstr.isIllegal() || oldInstr.isDeadPhi()) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
81 // if one operand is illegal, make the entire phi illegal |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
82 phi.makeDead(); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
83 phi.clearFlag(Value.Flag.PhiVisited); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
84 return phi; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
85 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
86 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
87 Value newInstr = simplify(oldInstr); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
88 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
89 if (newInstr == null || newInstr.isIllegal() || newInstr.isDeadPhi()) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
90 // if the subst instruction is illegal, make the entire phi illegal |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
91 phi.makeDead(); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
92 phi.clearFlag(Value.Flag.PhiVisited); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
93 return phi; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
94 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
95 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
96 // attempt to simplify this operand |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
97 if (!cannotSimplify) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
98 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
99 if (newInstr != phi && newInstr != phiSubst) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
100 if (phiSubst == null) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
101 phiSubst = newInstr; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
102 continue; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
103 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
104 // this phi cannot be simplified |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
105 cannotSimplify = true; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
106 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
107 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
108 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
109 if (cannotSimplify) { |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
110 phi.setFlag(Value.Flag.PhiCannotSimplify); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
111 phi.clearFlag(Value.Flag.PhiVisited); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
112 return phi; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
113 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
114 |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
115 // successfully simplified the phi |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
116 assert phiSubst != null : "illegal phi function"; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
117 phi.clearFlag(Value.Flag.PhiVisited); |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
118 return phiSubst; |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
119 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
120 } |
3fca504f28ba
Reinsert phi simplifier (does not seem to be optional). Disabled canonicalizer.
Thomas Wuerthinger <thomas@wuerthinger.net>
parents:
diff
changeset
|
121 } |