RFR: 8356176: C2 MemorySegment: missing RCE with byteSize() in Loop Exit Check inside the for Expression [v3]
Emanuel Peter
epeter at openjdk.org
Tue Aug 12 14:34:15 UTC 2025
On Tue, 12 Aug 2025 14:04:56 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:
>> src/hotspot/share/opto/loopnode.hpp line 1659:
>>
>>> 1657: }
>>> 1658: _total_wins++;
>>> 1659: }
>>
>> Why not make the `region` a field? That way, you don't have to pass it every time.
>>
>> And: if the region is a Loop, then we should have `_total_wins = _loop_entry_wins + _loop_back_wins`, correct? And if it is not a Loop, then the loop fields should be zero. You could add such an assert in `profitable` :)
>
>> And: if the region is a Loop, then we should have _total_wins = _loop_entry_wins + _loop_back_wins, correct?
>
> If a `LoopNode` can only have `EntryControl` and `LoopBackControl` as control inputs, it should be correct.
I think that is actually the very definition of a `LoopNode`: it has the entry edge on `in(1)` and the backedge on `in(2)` ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26429#discussion_r2270071534
More information about the hotspot-compiler-dev
mailing list