RFR: 8373355: C2: CompileCommand PrintIdealPhase should also print nodes that are not "reachable from below" [v3]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue Dec 16 09:33:54 UTC 2025
On Tue, 16 Dec 2025 08:52:45 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`.
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>
> Suggestion by Marc
Marked as reviewed by rcastanedalo (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/28762#pullrequestreview-3582158347
More information about the hotspot-compiler-dev
mailing list