Mercurial > hg > truffle
changeset 16040:7046c4061cc8
remove proxies when phis are removed
author | Lukas Stadler <lukas.stadler@oracle.com> |
---|---|
date | Thu, 05 Jun 2014 14:30:13 +0200 |
parents | 4c284376c374 |
children | f0efdd541094 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/PhiNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java |
diffstat | 2 files changed, 10 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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() {
--- 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<ValueNode> values = new NodeInputList<>(this);