RFR: 8332268: C2: Add missing optimizations for UDivI/L and UModI/L and unify the shared logic with the signed nodes
Emanuel Peter
epeter at openjdk.org
Mon Nov 25 09:32:15 UTC 2024
On Mon, 25 Nov 2024 09:13:31 GMT, theoweidmannoracle <duke at openjdk.org> wrote:
>> src/hotspot/share/opto/divnode.cpp line 518:
>>
>>> 516:
>>> 517: if (is_power_of_2(l)) {
>>> 518: return make_urshift<TypeClass>(div->in(1), phase->intcon(log2i_graceful(l)));
>>
>> Are we testing optimizations like these with random constants somewhere, and comparing it to the interpreter results?
>
> https://github.com/openjdk/jdk/pull/22061/files#diff-48b0b8da547a3fe6aae9ea3ef20b4d708e47f2332ff6884478336f39d9eb9459R82 and https://github.com/openjdk/jdk/pull/22061/files#diff-24679e6505fe23e8a3ba73decaaf97896899c0a10956c437b8721fca33706ee2R82 should cover this I think. The containing method is marked with @DontCompile.
You could use a similar trick with the constant method handles, as here:
https://github.com/openjdk/jdk/pull/21521/files#diff-d69ed849846cce04a18fe13fb35cd975ad533f0ef76d923745d97bdb27db7073
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22061#discussion_r1856223837
More information about the hotspot-compiler-dev
mailing list