--- old/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java 2019-03-12 08:09:46.971647053 +0100 +++ new/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java 2019-03-12 08:09:46.603644667 +0100 @@ -91,6 +91,18 @@ * @param other the other condition. */ public TriState implies(boolean thisNegated, LogicNode other) { + if (this == other) { + return TriState.get(!thisNegated); + } + if (other instanceof LogicNegationNode) { + return flip(this.implies(thisNegated, ((LogicNegationNode) other).getValue())); + } return TriState.UNKNOWN; } + + private static TriState flip(TriState triState) { + return triState.isUnknown() + ? triState + : TriState.get(!triState.toBoolean()); + } }