RFR: 8336860: x86: Change integer src operand for CMoveL of 0 and 1 to long
Quan Anh Mai
qamai at openjdk.org
Mon Jul 22 14:40:34 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!
Yes that was my mistake, thanks a lot for noticing and fixing
-------------
Marked as reviewed by qamai (Committer).
PR Review: https://git.openjdk.org/jdk/pull/20275#pullrequestreview-2191772988
More information about the hotspot-compiler-dev
mailing list