RFR: 8332268: C2: Add missing optimizations for UDivI/L and UModI/L and unify the shared logic with the signed nodes [v2]

theoweidmannoracle duke at openjdk.org
Mon Nov 25 13:18:27 UTC 2024


On Mon, 25 Nov 2024 13:10:52 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> theoweidmannoracle has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Resolve review comments
>
> src/hotspot/share/opto/divnode.cpp line 507:
> 
>> 505:     return nullptr;
>> 506:   }
>> 507:   Signed l = tl->get_con(); // Get divisor
> 
> You should get the unsigned type instead.

Also fixed in my latest commit.

> src/hotspot/share/opto/divnode.cpp line 513:
> 
>> 511:   }
>> 512: 
>> 513:   if (l == min_jint) {
> 
> Why excluding this case? You can move the check of division by 1 down here I think.

You're right. That's an error. I was working on this just now, see my latest commit.

> src/hotspot/share/opto/type.hpp line 2173:
> 
>> 2171: 
>> 2172: template <>
>> 2173: inline const TypeInt* Type::is<TypeInt>() const {
> 
> I think `cast` would be a better name

I named it `is` for consistency with all the other `is_*` methods but, of course, `cast` would be much less confusing. I'm not sure if we should be consistent or give this a more understandable name.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1856595486
PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1856593811
PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1856597066


More information about the hotspot-compiler-dev mailing list