RFR: 8373480: Optimize multiplication by constant multiplier using LEA instructions [v4]
Jatin Bhateja
jbhateja at openjdk.org
Mon Dec 22 07:28:06 UTC 2025
On Mon, 22 Dec 2025 05:59:14 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
> Nice improvement @jatin-bhateja, just some small comments
>
> Matt did an [Advent of Compiler Optimizations video](https://youtu.be/1X88od0miHs?si=wlYCsbZ1vmJA_rVf) precisely on this topic recently :)
Hi @galderz , Exaclty, JBS description clearly mentions that.
> test/micro/org/openjdk/bench/vm/compiler/ConstantMultiplierOptimization.java line 46:
>
>> 44: public class ConstantMultiplierOptimization {
>> 45:
>> 46: public static int mul_by_25_I(int a) {
>
> Should this and other methods be annotated with `@ForceInline` just in case?
Kernels are too small and should be inlined, but its better to force inlining, made that change, benchmark performance remains same.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28759#issuecomment-3680823623
PR Review Comment: https://git.openjdk.org/jdk/pull/28759#discussion_r2638921837
More information about the hotspot-dev
mailing list