RFR: 8319793: C2 compilation fails with "Bad graph detected in build_loop_late" after JDK-8279888 [v9]

Christian Hagedorn chagedorn at openjdk.org
Fri Jan 5 10:37:30 UTC 2024


On Fri, 5 Jan 2024 10:00:57 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/loopopts.cpp line 345:
>> 
>>> 343: 
>>> 344:   if (dp == nullptr)
>>> 345:     return;
>> 
>> Since we bail out above if `iff->outcnt() != 2` (can it even be that we have an `If` at this point which does not have 2 out projections?) this bailout seems redundant. Looks like it was only added due to a parfait report with https://github.com/openjdk/jdk/commit/25c4a7fccdbdaa9da0a7aa5e04e80966138fe42c. Maybe we can remove that as well and change `proj_out_or_null()` back to  `proj_out()` (not sure though if parfait will then report this again). But could also be done separately.
>
> Thanks for the details. Why would it have it been necessary before but no longer necessary now? What is it that has changed so parfait would not complain?

Unfortunately, the report details are no longer available today. I think the fix back there should have been that it's a false positive and it cannot happen that `dp` is null - even though parfait fails to prove that (it probably still cannot). I'm not exactly sure how parfait works and how we could ensure that it will not complain about this again but maybe adding an assert that `dp` is not null would help. Anyway, this should not block this PR and might be better handled separately.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16886#discussion_r1442720560


More information about the hotspot-compiler-dev mailing list