RFR: 8346038: [REDO] - [C1] LIR Operations with one input should be implemented as LIR_Op1

Vladimir Kozlov kvn at openjdk.org
Fri Jan 10 22:03:37 UTC 2025


On Fri, 10 Jan 2025 15:33:31 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> 1st commit: Same as https://github.com/openjdk/jdk/commit/a21d21f4d7b74e21f68b6bf9c5dc9ba7d3f9963c
>> 2nd commit: Removal of special "Knights Landing" code for `lir_abs` and `lir_neg` from C1.
>> 
>> Testing:
>> make run-test TEST="test/hotspot/jtreg/compiler" JTREG="VM_OPTIONS=-XX:UseAVX=3 -XX:+UnlockDiagnosticVMOptions -XX:+UseKNLSetting"
>> All passed.
>> 
>> This is how this PR changes the C1 code on Knights Landing CPUs (emulated by -XX:+UseKNLSetting):
>> 
>> `lir_abs` without this patch:
>> 
>> vmovsd -0x63(%rip),%xmm1
>> vpandnd %zmm0,%zmm1,%zmm0
>> 
>> 
>> `lir_neg` without this patch:
>> 
>> vmovsd -0x63(%rip),%xmm1
>> vpxord %zmm0,%zmm1,%zmm0
>> 
>> 
>> (The `vmovsd` loads the `LIR_OprFact::doubleConst(-0.0)`.)
>> 
>> `lir_abs` with this patch:
>> 
>> vandpd 0xa1b213d(%rip),%xmm0,%xmm0
>> 
>> 
>> `lir_neg` with this patch:
>> 
>> vxorpd 0xa12585d(%rip),%xmm0,%xmm0
>> 
>> 
>> New code is faster on our machine (using -XX:+UseKNLSetting).
>
> @vnkozlov: This is now the version with updates from @sviswa7. Could you help finding a reviewer and making sure it gets properly tested, please? I think this cleanup makes the code better readable (and also a bit faster). I also prefer handling `UseKNLSetting` in macroAssembler_x86.cpp instead of in multiple C1 files.

@TheRealMDoerr  please update Copyright year while I am testing.

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

PR Comment: https://git.openjdk.org/jdk/pull/22709#issuecomment-2584435413


More information about the hotspot-compiler-dev mailing list