Mercurial > hg > truffle
changeset 16195:e34d8c5fa927
do not create PiNode when lowering GuardingPiNode if the latter has no usages
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 19 Jun 2014 17:51:35 +0200 |
parents | 7fb828b4c32b |
children | 8bf243c2c87b |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Thu Jun 19 17:33:44 2014 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Thu Jun 19 17:51:35 2014 +0200 @@ -94,8 +94,10 @@ public void lower(LoweringTool tool) { GuardingNode guard = tool.createGuard(next(), condition, reason, action, negated); ValueAnchorNode anchor = graph().add(new ValueAnchorNode((ValueNode) guard)); - PiNode pi = graph().unique(new PiNode(object, stamp(), (ValueNode) guard)); - replaceAtUsages(pi); + if (usages().isNotEmpty()) { + PiNode pi = graph().unique(new PiNode(object, stamp(), (ValueNode) guard)); + replaceAtUsages(pi); + } graph().replaceFixedWithFixed(this, anchor); }