Integrated: 8280568: IGV: Phi inputs and pinned nodes are not scheduled correctly

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Tue May 3 07:31:23 UTC 2022


On Wed, 16 Feb 2022 11:05:17 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:

> This changeset improves the accuracy of IGV's schedule approximation algorithm by
> 
> 1) scheduling pinned nodes in the same block as their corresponding control nodes (or in the immediate successor block for nodes pinned to block projections); and
> 2) scheduling phi input nodes above the phi block, in their corresponding control path.
> 
> The combined effect of these scheduling improvements can be seen in the example below. In the current version of IGV **(before)**, `135 ClearArray` is wrongly scheduled in the same block as its output phi node (`91 Phi`). After this changeset **(after)**, `135 ClearArray` is correctly scheduled above the phi node, in its corresponding control path. Since `135 ClearArray` is pinned to the block projection `151 True`, a new block is created between `151 True` and `91 Phi` to accommodate it.
> 
> ![fix](https://user-images.githubusercontent.com/8792647/165956029-8e8bae8c-d836-444c-8861-2c13f52c22c6.png)
> 
> Additionally, the changeset introduces checks on graph invariants that are assumed by scheduling approximation (e.g. each block projection has a single control successor), warning the IGV user if these invariants are broken. Warning and gracefully degrading the approximated schedule is preferred to just failing since one of IGV's main use cases is debugging graphs which might be ill-formed. The warnings are reported both textually in the IGV log and visually for each node, if the corresponding filter ("Show node warnings") is active:
> 
> ![warning](https://user-images.githubusercontent.com/8792647/165957171-50c2bcb9-0247-45cc-b806-c4e811996ce4.png)
> 
> Node warnings are implemented as a general filter and can be used in custom filters for other purposes, for example highlighting nodes that match a certain property of interest.
> 
> #### Testing
> 
> ##### Functionality
> 
> - Tested manually that phi inputs and pinned nodes are scheduled correctly for a few selected graphs (included the reported one).
> 
> - Tested automatically that scheduling tens of thousands of graphs (by instrumenting IGV to schedule parsed graphs eagerly and running `java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4`) does not trigger any assertion failure and does not warn with the message "Phi input that does not dominate the phi's input block".
> 
> ##### Performance
> 
> Measured that the scheduling time is not slowed down for a selection of 89 large graphs (2511-7329 nodes). The performance results are attached (note that each measurement in the sheet corresponds to the median of ten runs).

This pull request has now been integrated.

Changeset: 7a483517
Author:    Roberto Castañeda Lozano <rcastanedalo at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/7a4835178d58b132773fec77b923095e36d1dcec
Stats:     431 lines in 8 files changed: 384 ins; 23 del; 24 mod

8280568: IGV: Phi inputs and pinned nodes are not scheduled correctly

Reviewed-by: kvn, thartmann

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

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


More information about the hotspot-compiler-dev mailing list