Integrated: 8373355: C2: CompileCommand PrintIdealPhase should also print nodes that are not "reachable from below"

Emanuel Peter epeter at openjdk.org
Tue Dec 16 09:37:15 UTC 2025


On Thu, 11 Dec 2025 08:40:42 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> PrintIdealPhase seems to only traverse the graph "from below". So if there are any nodes that are not reachable "from below" but only reachable "from above", then they do not show up in the printing.
> That is problematic: out TestFramework relies on that output, especially if you have some IR rule with failOn or count = 0 . The node would be in the graph, but the test tells you there is none.
> 
> Before the fix, we used to see this:
> The LoadI and StoreI do NOT show up during ITER_GVN1.
> This is because at that point, the infinite loop has no exit. So the loop is not connected down to Root.
> But once we do a first loop opts round, we see the LoadI and StoreI in PHASEIDEALLOOP1.
> This is because we insert a NeverBranch, which serves as an artificial exit, that connects the loop down to Root.
> 
> Fix: travese both up `+` and down `-`.
> 
> ---------------------------------
> 
> Note: I had to update some tests from https://github.com/openjdk/jdk/pull/22786.
> This is because during IGVN the constant nodes that lose all outputs are not removed. So now they show up in the IR graph, and the IR rules failed. I adjusted the IR rules to work with the operations `ModF/ModD` rather than constants `ConF/ConD`.

This pull request has now been integrated.

Changeset: 84028918
Author:    Emanuel Peter <epeter at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/8402891889c29894555eca6449ba63f7b7458124
Stats:     220 lines in 5 files changed: 165 ins; 10 del; 45 mod

8373355: C2: CompileCommand PrintIdealPhase should also print nodes that are not "reachable from below"

Reviewed-by: rcastanedalo, mchevalier, bmaillard

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

PR: https://git.openjdk.org/jdk/pull/28762


More information about the hotspot-compiler-dev mailing list