Mercurial > hg > graal-jvmci-8
changeset 22120:7f897280b00f
killWithUnusedFloatingInputs should kill trivial loop Phis
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 29 Jun 2015 10:13:14 -0700 |
parents | 6b5221d7b5c1 |
children | f9ca79a05f72 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java |
diffstat | 1 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java Mon Jun 29 17:24:09 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/util/GraphUtil.java Mon Jun 29 10:13:14 2015 -0700 @@ -152,8 +152,18 @@ public static void killWithUnusedFloatingInputs(Node node) { node.safeDelete(); node.acceptInputs((n, in) -> { - if (in.isAlive() && in.hasNoUsages() && !(in instanceof FixedNode)) { - killWithUnusedFloatingInputs(in); + if (in.isAlive() && !(in instanceof FixedNode)) { + if (in.hasNoUsages()) { + killWithUnusedFloatingInputs(in); + } else if (in instanceof PhiNode) { + for (Node use : in.usages()) { + if (use != in) { + return; + } + } + in.replaceAtUsages(null); + killWithUnusedFloatingInputs(in); + } } }); }