Mercurial > hg > graal-compiler
changeset 13124:aa9be8414779
Canonicalize GuardingPiNode to PiNode when guard is unnecessary
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Fri, 22 Nov 2013 11:56:46 -0800 |
parents | a4593e99f1ea |
children | c65150049959 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java |
diffstat | 1 files changed, 5 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Fri Nov 22 11:55:54 2013 -0800 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java Fri Nov 22 11:56:46 2013 -0800 @@ -108,10 +108,12 @@ if (c.getValue() == negated) { // The guard always fails return graph().add(new DeoptimizeNode(action, reason)); - } - - if (c.getValue() != negated && stamp().equals(object().stamp())) { + } else if (stamp().equals(object().stamp())) { + // The guard always succeeds, and does not provide new type information return object; + } else { + // The guard always succeeds, and provides new type information + return graph().unique(new PiNode(object, stamp())); } } return this;