RFR: 8322816: RISC-V: Incorrect guarantee in patch_vtype
Fei Yang
fyang at openjdk.org
Wed Jan 3 02:01:49 UTC 2024
On Wed, 3 Jan 2024 00:10:25 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> src/hotspot/cpu/riscv/assembler_riscv.hpp line 1160:
>>
>>> 1158: #define patch_vtype(hsb, lsb, vlmul, vsew, vta, vma, vill) \
>>> 1159: if (vill == 1) { \
>>> 1160: guarantee((vlmul | vsew | vta | vma) == 0, \
>>
>> I see the `vill` parameter is always false in current code, which means this guarantee never gets excecuted. And I don't think we would make use of the `vill` field of vtype in future. So I personally perfer to remove this guarantee and its enclosing if block for now.
>
> Rather than removing the guarantee, wouldn't it be better to guarantee/assert `vill == 0`?
> Although looking at uses, that argument is a bool, so it should be `guarantee(!vill, ...)`.
Hi, Yes, that's better. Maybe: `guarantee(!vill, "should be");`
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17215#discussion_r1440005337
More information about the hotspot-compiler-dev
mailing list