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

Marc Chevalier mchevalier at openjdk.org
Thu Sep 4 11:16:42 UTC 2025


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

>> src/hotspot/share/opto/graphInvariants.cpp line 301:
>> 
>>> 299:                     And::make(
>>> 300:                         new NodeClass(&Node::is_Region),
>>> 301:                         new Bind(region_node))))) {
>> 
>> This sort of binding is kinda cool! Never thought of it before. Could be really cool for general pattern matching.
>> We would have to find a solution if there would be multiple bindings though ... I think that's not possible with your patterns, right? Is that a fundamental constraint?
>
> What would be extra cool / funky:
> If we could somehow already cast the `Bind` variable to `Region`. Could be tricky.
> Doing this `is_Region and bind` could be a very common idiom, so very useful.

>  We would have to find a solution if there would be multiple bindings though ... I think that's not possible with your patterns, right? Is that a fundamental constraint?

Not sure what you mean? `And::make(new Bind(bla), AtInput(1, new Bind(bli)))`? You probably mean something else.


> If we could somehow already cast the Bind variable to Region. Could be tricky.
> Doing this is_Region and bind could be a very common idiom, so very useful.

Interesting... Not sure how with some template magic we don't have (like `Node::is<RegionNode>`) but probably doable with macros. I'll give it a try.

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

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


More information about the hotspot-compiler-dev mailing list