RFR: 8350864: C2: verify structural invariants of the Ideal graph [v3]

Marc Chevalier mchevalier at openjdk.org
Thu Sep 4 11:21:50 UTC 2025


On Mon, 25 Aug 2025 14:23:12 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Benoît's comments
>
> src/hotspot/share/opto/graphInvariants.cpp line 319:
> 
>> 317:       return CheckResult::FAILED;
>> 318:     }
>> 319:     return CheckResult::VALID;
> 
> Another funky idea: could probably be handled with some callback, some "terminal" check you do on the bound variable. Not sure if worth it.

It's difficult if we want to speak about more than one node. It cannot be part of the pattern since it'd be very non-local. Also with only one node, it must be executed at the end, and not when still traversing. I think it'd get even messier when we have a few bindings and we want to do things with them in a couple of different ways... Not sure how to express that much nicer.

> src/hotspot/share/opto/graphInvariants.cpp line 332:
> 
>> 330:     }
>> 331: 
>> 332:     Node_List ctrl_succ;
> 
> Do we need a `ResouceMark` for this?

Everything will run under `GraphInvariantChecker::run()` that has a `ResouceMark`. I'm not sure, but my guess is that it's not worth keeping entering and leaving resource marks for relatively short lists? At the very list, everything will be released at the end of the whole check. I can still add one here if you think it's better.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2321705602
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2321711388


More information about the hotspot-compiler-dev mailing list