RFR: 8342692: C2: long counted loop/long range checks: don't create loop-nest for short running loops [v32]
Emanuel Peter
epeter at openjdk.org
Tue May 27 07:57:08 UTC 2025
On Tue, 27 May 2025 07:20:33 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/loopnode.cpp line 1178:
>>
>>> 1176: // - CountedLoop: Can be reused.
>>> 1177: bool PhaseIdealLoop::short_running_loop(IdealLoopTree* loop, jint stride_con, const Node_List &range_checks,
>>> 1178: uint iters_limit) {
>>
>> Are only long-loops allowed, or can there be int loops here too?
>> You talk about long range checks, which makes me believe this is about long loops. But then below you check for the `bt` of the head, so could that be int?
>>
>> If it is about longs only: it would be nice to have an assert, and I would also rename the method to include the `long`.
>>
>> You may also want to say what the return `bool` means (success, the loop was indeed a short running (long?) loop).
>
> Hmm, or does the `int` `bt` come from `StressLongCountedLoop`, which complicates things here?
Could `iters_limit` be constant?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21630#discussion_r2108397256
More information about the hotspot-compiler-dev
mailing list