# HG changeset patch # User Andreas Woess # Date 1368707615 -7200 # Node ID b360b05aa9969d0f25403222bfd3729b62f157d0 # Parent d59af238b0e90f48d4d6f26f06578b1b815b0968 Quick fix for BranchProbabilityNode. diff -r d59af238b0e9 -r b360b05aa996 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 Tue May 28 16:44:25 2013 -0700 +++ b/graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/nodes/BranchProbabilityNode.java Thu May 16 14:33:35 2013 +0200 @@ -92,6 +92,9 @@ } } if (!couldSet) { + if (isSubstitutionGraph()) { + return this; + } throw new GraalInternalError("Wrong usage of branch probability injection!"); } return condition; @@ -99,6 +102,10 @@ return this; } + private boolean isSubstitutionGraph() { + return usages().count() == 1 && usages().first() instanceof ReturnNode && condition instanceof LocalNode; + } + /** * This intrinsic should only be used for the condition of an if statement. The parameter * condition should also only denote a simple condition and not a combined condition involving