When left-shifting the incoming VL parameter, it may cause overflow
when the vl >= 0x80000000, resulting in the wrong VL length setting.
For example this code and the output:
#include <riscv_vector.h> vint64m1_t test (vint64m1_t a, int64_t b) { return vslide1up_vx_i64m1(a, b, 0x80000000); } /* assembly output: test: vsetivli zero, 0, e32, m1, ta, mu vslide1up.vx v9, v8, a1 vslide1up.vx v8, v9, a0 ret */
The bug was caused by this commit.
This AVL should be I32VL to match the I32 type. It was wrong in the old code. It should have been scaled by 2. Since its gets pattern matched away during isel it probably doesn't really matter, but could to be logically correct.