RFR: 8336860: x86: Change integer src operand for CMoveL of 0 and 1 to long

Jasmine Karthikeyan jkarthikeyan at openjdk.org
Mon Jul 22 03:49:39 UTC 2024


On Mon, 22 Jul 2024 03:33:23 GMT, Jasmine Karthikeyan <jkarthikeyan at openjdk.org> wrote:

> Hi all,
> This patch fixes `cmovL_imm_01*` instructions matching against an integer immediate 1 instead of a long immediate 1. I noticed while looking at the backend implementation of CMove that the rules specify `immI_1` instead of `immL1`, which means that the instructions can't be matched and instead falls through to the base case. I added a small benchmark and got these results (time unit changed from us to ns for clarity):
> 
>                                               Baseline                     Patch           Improvement
> Benchmark             (size)  Mode  Cnt    Score    Error  Units     Score   Error  Units
> Longs.cmovConstant01     500  avgt   15  133.254 ± 14.804  ns/op    97.845 ± 2.486  ns/op  (+ 30.64%)
> 
> Thoughts and reviews would be appreciated!

Thanks for the heads up! I put them there since the change that originally introduced the code put its benchmarks there, but I think it would make sense to move it to `bench/vm/compiler`.

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

PR Comment: https://git.openjdk.org/jdk/pull/20275#issuecomment-2241986326


More information about the hotspot-compiler-dev mailing list