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

Emanuel Peter epeter at openjdk.org
Tue Sep 9 16:06:43 UTC 2025


On Tue, 9 Sep 2025 14:46:14 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

>> src/hotspot/share/opto/graphInvariants.cpp line 528:
>> 
>>> 526:     if (!center->is_CountedLoop() && !center->is_LongCountedLoop()) {
>>> 527:       return CheckResult::NOT_APPLICABLE;
>>> 528:     }
>> 
>> Actually: why not applie that to `OuterStripMinedLoop` as well? Or any `BaseCountedLoop`? Are there more than these 3 cases? If there are ever more, they should probably also adhere to this backedge pattern, we'll just need an extension. But it would be nice to trip over something here if we ever do extend.
>
> I'm going to push back on that. I rather want this one to be about counted loops, which have more structure that is HEAVILY relied on, that I haven't all enumerated, but that can be done.
> 
> One can make another check for the few things that hold for other flavors.

My understanding is this: Any kind of loop has to have a matching end node, and a backedge. That is essencially the structure you are checking for int and long loops, but it also holds for the other loops. If you don't want to do it now, then note it down and consider it in a future RFE ;)

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

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


More information about the hotspot-compiler-dev mailing list