RFR: 8350864: C2: verify structural invariants of the Ideal graph [v5]
Emanuel Peter
epeter at openjdk.org
Tue Sep 9 08:35:51 UTC 2025
On Tue, 9 Sep 2025 07:45:18 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
>> 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.
Once we have more complex patterns, will it really be that easy to see what was expected?
All you will see is what we actually got. You are already all about good reporting, so I just noticed a hole here.
You know the code better, so I'll leave it up to you in the end ;)
>> One advantage is definitively reporting. And it is still reasonably debuggable I think, my solution may be a little trickier that way.
>>
>> I think there are multiple factors:
>> - Simple: fewer abstractions can be easier to read/debug.
>> - Concise: few lines of code.
>> - Reporting: nice output when rules fail.
>
> I could have wrote this without pattern at all, but I also want to make more example of differently complex usage of patterns. Writing it without patterns at all would be pretty similar to me.
>
> I think the boilerplate has to exist somewhere. It's not nice to read, it's long, but it's (actually) simple. If we hide it somewhere, it's nicer to read and gives an impression of easier to understand, but harder to actually understand when something goes wrong. No strong opinion.
Yes, these are the trade-offs. Maybe we can discuss in the office, and pull in some others to discuss the pros and cons. Because if we are going to use Patterns more in other places, we should not shy away from doing some design brainstorming together. I really appreciate the new approach, and I can see a lot of benefits, including for IGVN.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2332497359
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2332483756
More information about the hotspot-compiler-dev
mailing list