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

Marc Chevalier mchevalier at openjdk.org
Tue Sep 9 07:48:26 UTC 2025


On Mon, 8 Sep 2025 16:08:37 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/graphInvariants.cpp line 234:
>> 
>>> 232:   bool check(const Node* center, Node_List& steps, GrowableArray<int>& path, stringStream& ss) const override {
>>> 233:     if (!(center->*_type_check)()) {
>>> 234:       ss.print_cr("Unexpected type: %s.", center->Name());
>> 
>> Is there a way we could say what we actually do expect? Not really, right? We'd need to do it via macro again.
>
> Or we pass a string .. not nice but would work with the macro for `NodeClassIsAndBind`. Not sure what's best here.

I thought about that and I think the current situation is ok. The pattern is not something highly mutable, it's mostly some hardcoded thing. I don't think it's hard to figure out what you're expecting. I'm very reluctant to add some ugliness to the patterns who must stay readable, to be easy to verify by a human. It could be solved with more templates tho.

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

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


More information about the hotspot-compiler-dev mailing list