src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java Thu Oct 31 14:23:06 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java Thu Oct 31 16:54:16 2019 -0700
@@ -349,12 +349,11 @@
TriState isAnchorInLoop = isLoopNode(anchor, loopNodes, nonLoopNodes);
if (isAnchorInLoop != TriState.FALSE) {
if (!(anchor instanceof LoopExitNode && ((LoopExitNode) anchor).loopBegin() == loopBeginNode)) {
- /*
- * (gd) this is wrong in general, it's completely avoidable while we
- * are doing loop transforms using ValueProxies. If it happens after
- * it could still cause problem.
- */
- assert !((GuardNode) current).graph().hasValueProxies();
+ // It is undecidable whether the node is in the loop or not. This is
+ // not an issue for getting counted loop information,
+ // but causes issues when using the information for actual loop
+ // transformations. This is why a loop transformation must
+ // not happen while guards are floating.
isLoopNode = true;
}
} else if (AbstractControlFlowGraph.strictlyDominates(cfg.blockFor(anchor), cfg.blockFor(loopBeginNode))) {