Mercurial > hg > graal-jvmci-8
comparison graal/GraalCompiler/src/com/sun/c1x/ir/If.java @ 2755:80b024e75b29
small fix for dead blocks
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Fri, 20 May 2011 14:50:04 +0200 |
parents | 6048da340364 |
children | ca31e84ff154 |
comparison
equal
deleted
inserted
replaced
2754:e91608c2daff | 2755:80b024e75b29 |
---|---|
114 | 114 |
115 /** | 115 /** |
116 * Gets the block corresponding to the true successor. | 116 * Gets the block corresponding to the true successor. |
117 * @return the true successor | 117 * @return the true successor |
118 */ | 118 */ |
119 public BlockBegin trueSuccessor() { | 119 public Instruction trueSuccessor() { |
120 return blockSuccessor(0); | 120 return blockSuccessor(0); |
121 } | 121 } |
122 | 122 |
123 /** | 123 /** |
124 * Gets the block corresponding to the false successor. | 124 * Gets the block corresponding to the false successor. |
125 * @return the false successor | 125 * @return the false successor |
126 */ | 126 */ |
127 public BlockBegin falseSuccessor() { | 127 public Instruction falseSuccessor() { |
128 return blockSuccessor(1); | 128 return blockSuccessor(1); |
129 } | 129 } |
130 | 130 |
131 /** | 131 /** |
132 * Gets the block corresponding to the specified outcome of the branch. | 132 * Gets the block corresponding to the specified outcome of the branch. |
133 * @param istrue {@code true} if the true successor is requested, {@code false} otherwise | 133 * @param istrue {@code true} if the true successor is requested, {@code false} otherwise |
134 * @return the corresponding successor | 134 * @return the corresponding successor |
135 */ | 135 */ |
136 public BlockBegin successor(boolean istrue) { | 136 public Instruction successor(boolean istrue) { |
137 return blockSuccessor(istrue ? 0 : 1); | 137 return blockSuccessor(istrue ? 0 : 1); |
138 } | 138 } |
139 | 139 |
140 /** | 140 /** |
141 * Gets the successor of this instruction for the unordered case. | 141 * Gets the successor of this instruction for the unordered case. |
142 * @return the successor for unordered inputs | 142 * @return the successor for unordered inputs |
143 */ | 143 */ |
144 public BlockBegin unorderedSuccessor() { | 144 public Instruction unorderedSuccessor() { |
145 return successor(unorderedIsTrue()); | 145 return successor(unorderedIsTrue()); |
146 } | 146 } |
147 | 147 |
148 /** | 148 /** |
149 * Swaps the operands to this if and reverses the condition (e.g. > goes to <=). | 149 * Swaps the operands to this if and reverses the condition (e.g. > goes to <=). |
161 * @see Condition#negate() | 161 * @see Condition#negate() |
162 */ | 162 */ |
163 public void swapSuccessors() { | 163 public void swapSuccessors() { |
164 unorderedIsTrue = !unorderedIsTrue; | 164 unorderedIsTrue = !unorderedIsTrue; |
165 condition = condition.negate(); | 165 condition = condition.negate(); |
166 BlockBegin t = blockSuccessor(0); | 166 Instruction t = blockSuccessor(0); |
167 BlockBegin f = blockSuccessor(1); | 167 Instruction f = blockSuccessor(1); |
168 setBlockSuccessor(0, f); | 168 setBlockSuccessor(0, f); |
169 setBlockSuccessor(1, t); | 169 setBlockSuccessor(1, t); |
170 } | 170 } |
171 | 171 |
172 @Override | 172 @Override |