167 168 @Override 169 protected Void merge(Block merge, List<Void> states) { 170 return null; 171 } 172 173 @Override 174 protected Void cloneState(Void oldState) { 175 return oldState; 176 } 177 178 @Override 179 protected List<Void> processLoop(Loop<Block> loop, Void initialState) { 180 LoopInfo<Void> info = ReentrantBlockIterator.processLoop(this, loop, initialState); 181 apply(loopMergeEffects.get(loop)); 182 return info.exitStates; 183 } 184 }; 185 ReentrantBlockIterator.apply(closure, cfg.getStartBlock()); 186 for (GraphEffectList effects : effectList) { 187 debug.log(" ==== effects"); 188 effects.apply(graph, obsoleteNodes, false); 189 } 190 /* 191 * Effects that modify the cfg (e.g., removing a branch for an if that got a constant 192 * condition) need to be performed after all other effects, because they change phi value 193 * indexes. 194 */ 195 for (GraphEffectList effects : effectList) { 196 debug.log(" ==== cfg kill effects"); 197 effects.apply(graph, obsoleteNodes, true); 198 } 199 debug.dump(DebugContext.DETAILED_LEVEL, graph, "After applying effects"); 200 assert VirtualUtil.assertNonReachable(graph, obsoleteNodes); 201 for (Node node : obsoleteNodes) { 202 if (node.isAlive() && node.hasNoUsages()) { 203 if (node instanceof FixedWithNextNode) { 204 assert ((FixedWithNextNode) node).next() == null; 205 } 206 node.replaceAtUsages(null); 207 GraphUtil.killWithUnusedFloatingInputs(node); 208 } 209 } 210 } 211 212 @Override 213 protected BlockT processBlock(Block block, BlockT state) { 214 if (!state.isDead()) { 215 GraphEffectList effects = blockEffects.get(block); 216 | 167 168 @Override 169 protected Void merge(Block merge, List<Void> states) { 170 return null; 171 } 172 173 @Override 174 protected Void cloneState(Void oldState) { 175 return oldState; 176 } 177 178 @Override 179 protected List<Void> processLoop(Loop<Block> loop, Void initialState) { 180 LoopInfo<Void> info = ReentrantBlockIterator.processLoop(this, loop, initialState); 181 apply(loopMergeEffects.get(loop)); 182 return info.exitStates; 183 } 184 }; 185 ReentrantBlockIterator.apply(closure, cfg.getStartBlock()); 186 for (GraphEffectList effects : effectList) { 187 effects.apply(graph, obsoleteNodes, false); 188 } 189 /* 190 * Effects that modify the cfg (e.g., removing a branch for an if that got a constant 191 * condition) need to be performed after all other effects, because they change phi value 192 * indexes. 193 */ 194 for (GraphEffectList effects : effectList) { 195 effects.apply(graph, obsoleteNodes, true); 196 } 197 debug.dump(DebugContext.DETAILED_LEVEL, graph, "After applying effects"); 198 assert VirtualUtil.assertNonReachable(graph, obsoleteNodes); 199 for (Node node : obsoleteNodes) { 200 if (node.isAlive() && node.hasNoUsages()) { 201 if (node instanceof FixedWithNextNode) { 202 assert ((FixedWithNextNode) node).next() == null; 203 } 204 node.replaceAtUsages(null); 205 GraphUtil.killWithUnusedFloatingInputs(node); 206 } 207 } 208 } 209 210 @Override 211 protected BlockT processBlock(Block block, BlockT state) { 212 if (!state.isDead()) { 213 GraphEffectList effects = blockEffects.get(block); 214 |