RFR: 8259984: IGV: Crash when drawing control flow before GCM

Christian Hagedorn chagedorn at openjdk.java.net
Thu Feb 18 10:35:38 UTC 2021


On Wed, 17 Feb 2021 12:23:55 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> The block formation algorithm applied by IGV to schedule graphs without associated CFG information traverses the graph backwards. This makes it difficult to deal with block projection nodes, leading in some cases to double addition of block nodes and block edges, and ultimately causing assertion failures.
> 
> This fix replaces the backward traversal by a forward traversal that relies on node category information (introduced in [8261336](https://bugs.openjdk.java.net/browse/JDK-8261336)) to identify control successors. The forward traversal is arguably simpler and, besides avoiding the reported assertion failure, has two advantages:
> 
> - it places block projection nodes in the same block as their predecessors, and
> - it numbers basic blocks more naturally.
> 
> The following screenshots illustrate the improvements (before the fix to the left, after the fix to the right):
> 
> ![cfgs-before-after](https://user-images.githubusercontent.com/8792647/108204708-6dcf5e00-7124-11eb-956c-fb7f84229b50.png)
> 
> Tested automatically on tens of thousands of graphs by running `java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4 ...` on an instrumented version of IGV that schedules graphs eagerly. Checked manually that the CFGs of a few selected graphs (included the reported one) are well-formed. Also checked that the overall IGV graph scheduling time is not affected by the changes.
> 
> Thanks to Christian Hagedorn for checking the fix independently.

Looks good to me! I played around with it in the IGV. I regularly got some assertion failure messages before - now they are gone now ��

src/utils/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/ServerCompilerScheduler.java line 634:

> 632:             }
> 633:         }
> 634: 

Maybe you could extract the following code into 2 separate methods.

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

Marked as reviewed by chagedorn (Reviewer).

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


More information about the hotspot-compiler-dev mailing list