RFR: 8353290: C2: Refactor PhaseIdealLoop::is_counted_loop() [v17]

Christian Hagedorn chagedorn at openjdk.org
Tue Nov 25 15:31:54 UTC 2025


On Wed, 12 Nov 2025 14:11:11 GMT, Kangcheng Xu <kxu at openjdk.org> wrote:

>> src/hotspot/share/opto/loopnode.hpp line 1338:
>> 
>>> 1336:       _back_control(back_control),
>>> 1337:       _loop(loop),
>>> 1338:       _phase(phase) {}
>> 
>> Maybe also add an assert here that `back_control` is non-null.
>
> I disagree: `back_control` is not nessarily non-null always. In fact, `loop_exit_control()` could return null even if `head` and `loop` are non-null. This is also why the original code explicitly checks this as well.

You're right, it could be null.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24458#discussion_r2560017691


More information about the hotspot-compiler-dev mailing list