RFR: 8265587: IGV: track nodes across matching

Vladimir Ivanov vlivanov at openjdk.java.net
Tue Apr 27 17:28:38 UTC 2021


On Fri, 23 Apr 2021 12:31:20 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> This change preserves, as much as possible, the IGV node identifier of Ideal nodes in their corresponding machine nodes created by `Matcher::match()`. This makes it possible to track nodes when stepping from "Before matching" to "After matching" in IGV, as illustrated for an extracted compare-and-branch subgraph in the following screenshot: 
> 
> ![before-after-matching](https://user-images.githubusercontent.com/8792647/115867587-94b75280-a43b-11eb-8a79-9c13a0a68d42.png)
> 
> #### Limitations
> This solution preserves most of the node relations across matching, however if an Ideal node is expanded into multiple machine nodes, only one of them is assigned the IGV identifier of the Ideal node (since IGV identifiers need to be unique within a compilation phase). This limitation can be seen in the following example, where the `CmpU` Ideal node is implemented with three `compU_rReg` machine nodes (one for each `jmpConU` machine node), but only one of the `compU_rReg` machine nodes (50) preserves the IGV identifier:
> 
> ![before-after-matching-limitation](https://user-images.githubusercontent.com/8792647/115869469-3770d080-a43e-11eb-9ede-d8845862c7bd.png)
> 
> Overcoming this limitation would require explicitly serializing the entire before-after relation among nodes and adapting IGV's node selection and graph difference logic, which seems too complex for a relatively infrequent case.
> 
> #### Testing
> - Regression-tested HotSpot changes on hs-tier1-3, windows-x64, linux-x64, linux-aarch64, and macosx-x64 (both release and debug).
> - Tested HotSpot graph generation and IGV graph loading and scheduling on tens of thousands of graphs by running `java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4 ...` on an instrumented IGV. Loading and scheduling are useful graph well-formedness tests, as they tend to fail for incorrect graphs, e.g. with repeated node identifiers.
> - Tested manually, for a few graphs, that nodes of different types can be tracked across matching.

Looks good.

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

Marked as reviewed by vlivanov (Reviewer).

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


More information about the hotspot-compiler-dev mailing list