-
- Downloads
RISC-V: Fix VSETVL PASS regression
This patch is regression fix patch, not an optimization patch. Since trunk GCC generates redundant vsetvl than GCC-13. This is the case: bb 2: def a2 (vsetvl a2, zero) bb 3: use a2 bb 4: use a2 (vle) before this patch: bb 2: vsetvl a2 zero bb 3: vsetvl zero, zero ----> should be eliminated. bb 4: vle.v The root cause is we didn't set bb 3 as transparent since the incorrect codes. bb 3 didn't modify "a2" just use it, the VSETVL status from bb 2 can be available to bb 3 and bb 4: bb 2 -> bb 3 -> bb4. Another regression fix is anticipation calculation: bb 4: use a5 (sub) use a5 (vle) The vle VSETVL status should be considered as anticipated as long as both sub and vle a5 def are coming from same def. Tested on zvl128b no regression. I am going to test on zvl256/zvl512/zvl1024 PR target/112713 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pre_vsetvl::compute_lcm_local_properties): Fix regression. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/pr112713-1.c: New test. * gcc.target/riscv/rvv/vsetvl/pr112713-2.c: New test.
Showing
- gcc/config/riscv/riscv-vsetvl.cc 20 additions, 9 deletionsgcc/config/riscv/riscv-vsetvl.cc
- gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr112713-1.c 24 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr112713-1.c
- gcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr112713-2.c 47 additions, 0 deletionsgcc/testsuite/gcc.target/riscv/rvv/vsetvl/pr112713-2.c
Loading
Please register or sign in to comment