RFR: 8282204: Use lea instructions for arithmetic operations on x86_64 [v2]

Vladimir Kozlov kvn at openjdk.java.net
Tue Feb 22 17:18:47 UTC 2022


On Tue, 22 Feb 2022 12:01:30 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:
> 
>   decoder, format

What benefits you have with these changes in real world?
It could be fine to use `lea` for merging several instruction, as you did.
But last time I was told that `lea` instruction has larger latency than shift instruction because it uses addressing module in CPU. I am not sure it is fine to replace it.
Also why you removed match rule which moved result of `Add` to different register?

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

PR: https://git.openjdk.java.net/jdk/pull/7560


More information about the hotspot-compiler-dev mailing list