Meaning when "AVL" is a reg and appears once, we will eliminate "AVL" operand 
in uses.
If it appears more than once, we don't eliminate the "AVL" operand in uses.

You can this case:
vint8m1_t b = __riscv_vadd_vx_i8m1 (a, vl, vl);

Here you can see "vl" variable not only serves as the "AVL" which is used in 
vsetvli but also it serves as "scalar operand" involved in the vadd.vx 
operation.
In this case, we can eliminate the operand "vl"

However, vint8m1_t b = __riscv_vadd_vx_i8m1 (a, x, vl);
This case you can see "vl" operand only serves as "avl" which is used already 
in vsetvli instructions before, so this operand is not used anymore in 
"vadd.vx" instruction,
I removed this operand and dependency.

Feel free to give me more comments. Thanks.


juzhe.zh...@rivai.ai
 
From: Jeff Law
Date: 2023-04-19 09:11
To: juzhe.zh...@rivai.ai; kito.cheng; Richard Biener
CC: gcc-patches; palmer
Subject: Re: [PATCH] RISC-V: Fix bug reported by PR109535
 
 
On 4/18/23 19:04, juzhe.zh...@rivai.ai wrote:
> The bug issue reported by google/highway project:
> (set(..........)
>         (reg:QI s0)
> (reg:DI s0))
> 
> The "avl" operand rtx  = (reg:DI s0)
> count_occurrences return 1 however the actual regno occurrences should be 2.
> In this case, the VSETVL PASS will eliminate the use of (reg:DI s0) then 
> file assertion in RTL_SSA.
> Instead, we should not eliminate "s0" dependency.
So these are not vector hard registers, but GPR hard registers.  Meaning 
you have to worry about even more things.  Consider case on rv32 when 
you ask to count (reg:QI s1) and there is a reference to (reg:DI s0).
 
Prior to reload you also have to worry about SUBREGs.
 
 
You probably need to be using refers_to_regno_p or something similar.
 
jeff
 

Reply via email to