RFR: 8259984: IGV: Crash when drawing control flow before GCM [v2]
Nils Eliasson
neliasso at openjdk.java.net
Thu Feb 18 12:41:39 UTC 2021
On Thu, 18 Feb 2021 12:06:53 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.
>
> Roberto Castañeda Lozano has updated the pull request incrementally with one additional commit since the last revision:
>
> Extract new logic out of buildUpGraph()
Marked as reviewed by neliasso (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/2607
More information about the hotspot-compiler-dev
mailing list