RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v6]
Quan Anh Mai
duke at openjdk.java.net
Mon Feb 28 15:31:49 UTC 2022
On Mon, 28 Feb 2022 12:01:31 GMT, Quan Anh Mai <duke at openjdk.java.net> wrote:
>> Hi,
>>
>> This patch adds several matching rules for x86_64 backend to use `lea` instructions for several fused arithmetic operations. Also, `lea`s don't kill flags and allow different `dst` and `src`, so it is preferred over `sll` if possible, too.
>>
>> Thank you very much.
>
> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>
> reviews
The reason for the second bullet point is that for `lea`s containing 2 register operands with the base register being `rbp` or `r13`, the assembler must emit a displacement even if it is 0. In another word, the cause for the regression observed in the second bullet point is the same as the first one. As a consequence, if we can execute the 3-operand `lea` efficiently then we don't have to worry about the base register. Thanks.
Assembler address emission:
https://github.com/openjdk/jdk/blob/4e7fb41dafaf03baabe18ee1dabefed50d69e16d/src/hotspot/cpu/x86/assembler_x86.cpp#L583
Measurement with `rbp` as base:
Throughput:
https://bit.ly/3pnT9ms
Latency:
https://bit.ly/3tcJTTv
-------------
PR: https://git.openjdk.java.net/jdk/pull/7560
More information about the hotspot-compiler-dev
mailing list