RFR: 8373480: Optimize multiplication by constant multiplier using LEA instructions [v6]
Emanuel Peter
epeter at openjdk.org
Fri Jan 9 12:07:12 UTC 2026
On Fri, 9 Jan 2026 10:20:40 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:
>> Ah, I see now that these are the values from your lookup table in the optimization.
>>
>> I think it would still be good if you added random values, just for result verification.
>> And only enable IR rules for the special values.
>
> We also do some clever optimization for POT multiplier in MulI/MulLNode::Ideal routines which breaks multiplication into LShift/Add/Sub nodes and but its target agnostic.
>
> Reason why I only selected these constants were because we are specifically handling these cases through optimum LEA based instruction sequence in the backend and Machine level IR annotation guarantees that required constant operand patten was indeed selected during matching.
Right I understand. But it is generally a good idea to not just verify your specific values, but also fuzz around a bit, just in case your optimization messes up and touches other cases near by.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28759#discussion_r2675947140
More information about the hotspot-compiler-dev
mailing list