# HG changeset patch # User Lukas Stadler # Date 1401971413 -7200 # Node ID 7046c4061cc8c0185a144fd8669c3fa14e00582c # Parent 4c284376c3743c8be6d792297570ba1278a1e3d3 remove proxies when phis are removed diff -r 4c284376c374 -r 7046c4061cc8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Mon May 26 17:12:09 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java Thu Jun 05 14:30:13 2014 +0200 @@ -158,14 +158,19 @@ } @Override - public Node canonical(CanonicalizerTool tool) { + public void simplify(SimplifierTool tool) { ValueNode singleValue = singleValue(); if (singleValue != null) { - return singleValue; + for (Node node : usages().snapshot()) { + if (node instanceof ProxyNode && ((ProxyNode) node).proxyPoint() instanceof LoopExitNode && ((LoopExitNode) ((ProxyNode) node).proxyPoint()).loopBegin() == merge) { + node.usages().forEach(tool::addToWorkList); + graph().replaceFloating((FloatingNode) node, singleValue); + } + } + graph().replaceFloating(this, singleValue); + usages().forEach(tool::addToWorkList); } - - return this; } public ValueNode firstValue() { diff -r 4c284376c374 -r 7046c4061cc8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java Mon May 26 17:12:09 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java Thu Jun 05 14:30:13 2014 +0200 @@ -32,7 +32,7 @@ * variable. */ @NodeInfo(nameTemplate = "ValuePhi({i#values})") -public class ValuePhiNode extends PhiNode implements Canonicalizable { +public class ValuePhiNode extends PhiNode implements Simplifiable { @Input final NodeInputList values = new NodeInputList<>(this);