RFR: 8332268: C2: Add missing optimizations for UDivI/L and UModI/L and unify the shared logic with the signed nodes [v3]
Emanuel Peter
epeter at openjdk.org
Mon Nov 25 14:19:18 UTC 2024
On Mon, 25 Nov 2024 14:11:45 GMT, theoweidmannoracle <duke at openjdk.org> wrote:
>> src/hotspot/share/opto/divnode.cpp line 1213:
>>
>>> 1211: }
>>> 1212: // X MOD X is 0
>>> 1213: if (mod->in(1) == mod->in(2)) {
>>
>> `mod->in(1)->eqv_uncast(mod->in(2))`
>
> This is analogous to code for ModI/LNode::Ideal.
That may be true. But `uncast` would be still a good idea, so that we can see through `Cast` nodes. I think it could then also be added to `ModI/L`.
@merykitty do you have an easy way to unit test this, i.e. to have a test with a Cast?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1856693190
More information about the hotspot-compiler-dev
mailing list