RFR: 8328528: C2 should optimize long-typed parallel iv in an int counted loop [v17]
Kangcheng Xu
kxu at openjdk.org
Fri Sep 27 21:55:26 UTC 2024
On Fri, 27 Sep 2024 12:24:32 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/loopopts/parallel_iv/TestParallelIvInIntCountedLoop.java line 349:
>>
>>> 347: int init1 = rng.nextInt();
>>> 348: int init2 = rng.nextInt(Integer.MIN_VALUE + i + 1, i);
>>> 349: long init1L = rng.nextLong(Long.MIN_VALUE + i + 1, i);
>>
>> I understand the init2 computation I think (i - init2 should not overflow max signed int value) but I don't understand the `init1L` one. As far as I can tell, `init1L` is used the same way `init1` is used but one is for a test with a long variable and the other for a int variable. Why don't they use the same initialization pattern then?
>
> Can you add a comment as well?
Good point. You're right. I don't know why I did that.
Added a comment about it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18489#discussion_r1779209829
More information about the hotspot-compiler-dev
mailing list