# HG changeset patch # User Thomas Wuerthinger # Date 1366906644 -7200 # Node ID 83992e8ebc7b4e983e98979aad6d95a757ba4408 # Parent 2b62ddcf8fd8492794547931c8e4f07324b8bb79 Delay the reporting of an error in the branch probability injection node. diff -r 2b62ddcf8fd8 -r 83992e8ebc7b graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BranchProbabilityNode.java --- a/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BranchProbabilityNode.java Thu Apr 25 18:11:30 2013 +0200 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BranchProbabilityNode.java Thu Apr 25 18:17:24 2013 +0200 @@ -69,7 +69,7 @@ } BeginNode begin = (BeginNode) current; if (!(begin.predecessor() instanceof IfNode)) { - throw new GraalInternalError("Injected branch probability cannot follow a merge, only if nodes"); + return; } IfNode ifNode = (IfNode) begin.predecessor(); if (ifNode.trueSuccessor() == begin) { @@ -92,7 +92,11 @@ @Override public void lower(LoweringTool tool, LoweringType loweringType) { - throw new GraalInternalError("Branch probability could not be injected, because the probability value did not reduce to a constant value."); + if (probability.isConstant()) { + throw new GraalInternalError("Injected branch probability must follow an if node."); + } else { + throw new GraalInternalError("Branch probability could not be injected, because the probability value did not reduce to a constant value."); + } } }