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

theoweidmannoracle duke at openjdk.org
Thu Nov 28 10:07:23 UTC 2024


On Mon, 25 Nov 2024 14:16:47 GMT, theoweidmannoracle <duke at openjdk.org> wrote:

>> src/hotspot/share/opto/divnode.cpp line 488:
>> 
>>> 486: 
>>> 487:   const Type* t = phase->type(div->in(2));
>>> 488:   if (t == TypeClass::ONE) { // Identity?
>> 
>> You can move this into `l == 0 || l == 1` below.
>
> This is also the same for ModI/LNode::Ideal. I think all of this code should be reviewed as part of an RFE and then changed together

Fixed

>> src/hotspot/share/opto/divnode.cpp line 1184:
>> 
>>> 1182: 
>>> 1183:   if (con == 1) {
>>> 1184:     return ConNode::make(TypeClass::ZERO);
>> 
>> This should be in `Value` instead.
>
> This is analogous to code for ModI/LNode::Ideal. I'll file an RFE that this should be changed in all locations

Fixed

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1861867154
PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1861867030


More information about the hotspot-compiler-dev mailing list