RFR: 8373355: C2: CompileCommand PrintIdealPhase should also print nodes that are not "reachable from below" [v3]
Emanuel Peter
epeter at openjdk.org
Tue Dec 16 08:52:45 UTC 2025
> 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`.
Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
Suggestion by Marc
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28762/files
- new: https://git.openjdk.org/jdk/pull/28762/files/769640f2..42ce8ed0
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28762&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28762&range=01-02
Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
Patch: https://git.openjdk.org/jdk/pull/28762.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28762/head:pull/28762
PR: https://git.openjdk.org/jdk/pull/28762
More information about the hotspot-compiler-dev
mailing list