RFR: 8361608: C2: assert(opaq->outcnt() == 1 && opaq->in(1) == limit) failed [v5]

Christian Hagedorn chagedorn at openjdk.org
Wed Oct 22 09:16:07 UTC 2025


On Wed, 22 Oct 2025 09:10:40 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> Marc Chevalier has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Check before
>
> src/hotspot/share/opto/loopnode.cpp line 4779:
> 
>> 4777:         if (!head->is_pre_loop() && !head->is_post_loop()) {
>> 4778:           assert(opaque->outcnt() == 1 && opaque->in(1) == head->limit(), "IGVN should have cleaned that up!");
>> 4779:         }
> 
> I think we can just check `is_main_loop()` here. `is_canonical_loop_entry()` will bail out if we see anything else than main or post loops:
> 
> https://github.com/openjdk/jdk/blob/bdfd5e843a7d3db50edf4375e50449b0ce528f8a/src/hotspot/share/opto/loopnode.cpp#L6330-L6333
> 
> 
> Suggestion:
> 
>         if (head->is_main_loop()) {
>           assert(opaque->outcnt() == 1 && opaque->in(1) == head->limit(), "IGVN should have cleaned that up!");
>         }

Maybe you can even go a step further and also check that for the post loop, `outcnt()` is also 1 which should hold as well.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27586#discussion_r2451106340


More information about the hotspot-compiler-dev mailing list