RFR: 8334554: RISC-V: verify & fix perf of string comparison [v2]

Hamlin Li mli at openjdk.org
Tue Jun 25 12:13:13 UTC 2024


On Tue, 25 Jun 2024 11:52:37 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> I just tried m1 like following change, it only brings negative impact on banana-pi. So ignore my previous comment.
>> 
>> diff --git a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
>> index 9ce197a44bf..24ebc1fbe54 100644
>> --- a/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
>> +++ b/src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp
>> @@ -2331,7 +2331,7 @@ void C2_MacroAssembler::element_compare(Register a1, Register a2, Register resul
>>    Assembler::SEW sew = islatin ? Assembler::e8 : Assembler::e16;
>> 
>>    bind(loop);
>> -  vsetvli(tmp1, cnt, sew, Assembler::m2);
>> +  vsetvli(tmp1, cnt, sew, Assembler::m1);
>>    vlex_v(vr1, a1, sew);
>>    vlex_v(vr2, a2, sew);
>>    vmsne_vv(vrs, vr1, vr2);
>
>> By [#18382 (comment)](https://github.com/openjdk/jdk/pull/18382#discussion_r1645356197), do you mean current lastest implementation of it still brings negative impact on performance after [1d4320b](https://github.com/openjdk/jdk/commit/1d4320b205c173256eb6a50cedaa0ccd9b4122d8)?
> 
> Yes.

I think we should focus on small sized string optimization, please check this report about the string size distribution, https://cr.openjdk.org/~shade/density/string-density-report.pdf

And based on current tests on both boards, I adjust the lmul and v reg based on 2 factors, ie. MaxVectorSize and (LL or UU)?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19825#discussion_r1652689562


More information about the hotspot-compiler-dev mailing list