RFR: 8347481: C2: Remove the control input of some nodes
Vladimir Ivanov
vlivanov at openjdk.org
Thu Jan 16 02:57:39 UTC 2025
On Thu, 16 Jan 2025 01:26:10 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:
>> Any undesireable performance effects if CMove node floats up beyond its (original) control? It may have changed on modern hardware, but my recollection is cmov instructions were quite expensive to execute.
>
> @iwanowww A cmov is as cheap as an add so I don't think there will be any performance effect. I believe what you mean by cmov being expensive is that it has 1 cycle of latency on both of its inputs, while a well-predicted if diamond has 0 cycle of latency on the chosen input only.
Right, my memory failed me. Indeed I was referring to *relative* slowness of cmov instructions compared to well-predicted conditional jumps which is not relevant here.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23055#discussion_r1917593490
More information about the hotspot-compiler-dev
mailing list