RFR: JDK-8272574: C2: assert(false) failed: Bad graph detected in build_loop_late [v8]

Christian Hagedorn chagedorn at openjdk.java.net
Mon Aug 23 12:30:31 UTC 2021


On Mon, 23 Aug 2021 08:32:12 GMT, 王超 <github.com+25214855+casparcwang at openjdk.org> wrote:

>> Current loop predication will promote nodes(with a dependency on a later control node) to the insertion point which dominates the later control node.
>> 
>> In the following example, loopPrediction will promote node 434 to the outer loop(predicted insert point is right after node 424), and it depends on control node 207.  But node 424 dominates node 207, which means after the promotion, the cloned nodes have a control dependency on a later control node, which leads to a bad graph.
>> 
>> ![image](https://user-images.githubusercontent.com/25214855/129720970-ff65b8f4-8bef-401d-8590-54aca6de470e.png)
>> 
>> ![image](https://user-images.githubusercontent.com/25214855/129721369-4c61222b-7305-4522-9a37-e3e6e2138aa9.png)
>
> 王超 has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Make the comment more professional

> > Otherwise, looks good! Thanks for making these changes.
> > I tested your code through tier1-7 over the weekend. Test results looked good!
> 
> Thanks for your help and testing. I have also run tests during last weekend, and find no problem currently.

Great! I'm curious what others think about it.

src/hotspot/share/opto/loopPredicate.cpp line 674:

> 672:       // Previously promoted loop predication is in the same loop of predication
> 673:       // point.
> 674:       // This situation can occur when pinning nodes too conservatively. - can we do better?

Dot can be removed before the `-`.

-------------

Marked as reviewed by chagedorn (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/5142


More information about the hotspot-compiler-dev mailing list