RISC-V: Fix ICE for the fusion case from vsetvl to scalar move[PR111927]
ICE:
during RTL pass: vsetvl
<source>: In function 'riscv_lms_f32':
<source>:240:1: internal compiler error: in merge, at config/riscv/riscv-vsetvl.cc:1997
240 | }
In general compatible_p (avl_equal_p) has:
if (next.has_vl () && next.vl_used_by_non_rvv_insn_p ())
return false;
Don't fuse AVL of vsetvl if the VL operand is used by non-RVV instructions.
It is reasonable to add it into 'can_use_next_avl_p' since we don't want to
fuse AVL of vsetvl into a scalar move instruction which doesn't demand AVL.
And after the fusion, we will alway use compatible_p to check whether the demand
is correct or not.
PR target/111927
gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc: Fix bug.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/vsetvl/pr111927.c: New test.