347 if (isLoopNode(guard.getCondition(), loopNodes, nonLoopNodes) != TriState.FALSE) { |
347 if (isLoopNode(guard.getCondition(), loopNodes, nonLoopNodes) != TriState.FALSE) { |
348 ValueNode anchor = guard.getAnchor().asNode(); |
348 ValueNode anchor = guard.getAnchor().asNode(); |
349 TriState isAnchorInLoop = isLoopNode(anchor, loopNodes, nonLoopNodes); |
349 TriState isAnchorInLoop = isLoopNode(anchor, loopNodes, nonLoopNodes); |
350 if (isAnchorInLoop != TriState.FALSE) { |
350 if (isAnchorInLoop != TriState.FALSE) { |
351 if (!(anchor instanceof LoopExitNode && ((LoopExitNode) anchor).loopBegin() == loopBeginNode)) { |
351 if (!(anchor instanceof LoopExitNode && ((LoopExitNode) anchor).loopBegin() == loopBeginNode)) { |
352 /* |
352 // It is undecidable whether the node is in the loop or not. This is |
353 * (gd) this is wrong in general, it's completely avoidable while we |
353 // not an issue for getting counted loop information, |
354 * are doing loop transforms using ValueProxies. If it happens after |
354 // but causes issues when using the information for actual loop |
355 * it could still cause problem. |
355 // transformations. This is why a loop transformation must |
356 */ |
356 // not happen while guards are floating. |
357 assert !((GuardNode) current).graph().hasValueProxies(); |
|
358 isLoopNode = true; |
357 isLoopNode = true; |
359 } |
358 } |
360 } else if (AbstractControlFlowGraph.strictlyDominates(cfg.blockFor(anchor), cfg.blockFor(loopBeginNode))) { |
359 } else if (AbstractControlFlowGraph.strictlyDominates(cfg.blockFor(anchor), cfg.blockFor(loopBeginNode))) { |
361 // The anchor is above the loop. The no-usage guard can potentially be |
360 // The anchor is above the loop. The no-usage guard can potentially be |
362 // scheduled inside the loop. |
361 // scheduled inside the loop. |