RFR: 8350864: C2: verify structural invariants of the Ideal graph [v3]
Marc Chevalier
mchevalier at openjdk.org
Thu Sep 4 10:53:43 UTC 2025
On Mon, 25 Aug 2025 14:09:09 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/graphInvariants.cpp line 270:
>>
>>> 268: new HasNOutputs(2),
>>> 269: new AtSingleOutputOfType(&Node::is_IfTrue, new True()),
>>> 270: new AtSingleOutputOfType(&Node::is_IfFalse, new True()))) {
>>
>> I would suggest that you append the word `Pattern` to all `Patterns` - at least in most cases this will make it a bit easier to see what you have at the use-site. I'm looking at `new True()` and wonder what might be passed here... if it was called `TruePattern`, it would be immediately clear.
>
> You could leave a comment at `True(Pattern)` that it is (often) used as the terminal pattern, at the end of a branch / search.
> I would suggest that you append the word Pattern to all Patterns - at least in most cases this will make it a bit easier to see what you have at the use-site. I'm looking at new True() and wonder what might be passed here... if it was called TruePattern, it would be immediately clear.
For `True` alright, no strong opinion. Could also be `TrivialPattern` or so. For everything else, that looks very verbose and hurts readability a lot, and I think readability is very important. I think the other patterns are pretty understandable: for instance, I don't see how `HasAtLeastNInputsPattern` would really help compared to `HasAtLeastNInputs`, it seems just like bloat my brain will have to strip.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26362#discussion_r2321622684
More information about the hotspot-compiler-dev
mailing list