Thanks Jeff.
Address Jeff's comment and resend fix patch:
https://gcc.gnu.org/pipermail/gcc-patches/2023-April/616170.html
This patch also added a testcase coming from Kito (Kito reduced google/highway
testcase from over 10W lines codes into 100 lines codes!!!).
juzhe.zh...@rivai.ai
From: J
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
I tried refers_to_regno_p
It can not work for us since it just return true or false whether the "rtx" has
the regno.
In our situation, we remove "AVL" dependency when it appears once in the "rtx"
otherwise, we don't eliminate "AVL" dependency.
Would you mind giving me more suggestions?
Thanks
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