RFR: 8265587: IGV: track nodes across matching

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Fri Apr 23 12:45:51 UTC 2021


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.

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

Commit messages:
 - Refine description of Node::_igv_idx
 - Reuse Ideal-level IGV identifiers in machine nodes

Changes: https://git.openjdk.java.net/jdk/pull/3654/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3654&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8265587
  Stats: 50 lines in 4 files changed: 20 ins; 13 del; 17 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3654.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3654/head:pull/3654

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


More information about the hotspot-compiler-dev mailing list