RFR: 8349361: C2: RShiftL should support all applicable transformations that RShiftI does [v2]

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Sat Feb 8 21:58:10 UTC 2025


On Fri, 7 Feb 2025 10:02:44 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> src/hotspot/share/opto/mulnode.cpp line 1399:
>> 
>>> 1397:     assert(lo <= hi, "must have valid bounds");
>>> 1398: #ifdef ASSERT
>>> 1399:    if (bt ==T_INT) {
>> 
>> Suggestion:
>> 
>>    if (bt == T_INT) {
>> 
>> Could this assert be generic to also handle T_LONG too?
>
> The assert checks that, for the int case:
> 
> 
> long lo;
> assert((int)(lo >> shift) == (((int)lo) >> shift, "");
> 
> For long, it would be:
> 
> long lo;
> assert((long)(lo >> shift) == (((long)lo) >> shift, "");
> 
> Given everything is already a long, that's:
> 
> long lo;
> assert(lo >> shift == lo >> shift, "");

Ah I see, thank you for the explanation!

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23438#discussion_r1947962232


More information about the hotspot-compiler-dev mailing list