RFR: 8350864: C2: verify structural invariants of the Ideal graph [v3]
Emanuel Peter
epeter at openjdk.org
Fri Sep 5 07:53:18 UTC 2025
On Thu, 4 Sep 2025 11:19:13 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
>> 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.
I would do it defensively. Might save us from out-of-memory later on with higher tiers, and it could also make things faster: i.e. we might avoid timeouts, just because we need less memory. I don't have the overview how large these are and how many you'd create, so maybe it is unnecessary. Up to you.
>> src/hotspot/share/opto/graphInvariants.cpp line 447:
>>
>>> 445: And::make(
>>> 446: new NodeClass(&Node::is_IfTrue),
>>> 447: new HasAtLeastNInputs(1),
>>
>> Can an `IfTrue` have more than 1 input?
>
> I surely hope not!
Then I would assert that it has exactly 1 input instead ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2324357889
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2324360409
More information about the hotspot-compiler-dev
mailing list