RISC-V: Fix VSETVL PASS bug
commitc9d5b46a25547035e381b0246de5cb553ca8b02d
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Wed, 6 Dec 2023 14:26:46 +0000 (6 22:26 +0800)
committerPan Li <pan2.li@intel.com>
Wed, 6 Dec 2023 14:35:18 +0000 (6 22:35 +0800)
tree3e00bc1fb0e732482204d52711e7337e45e5f665
parentc1e54c82a9e1855499ef7bb8827540e6a097532b
RISC-V: Fix VSETVL PASS bug

As PR112855 mentioned, the VSETVL PASS insert vsetvli in unexpected location.

Due to 2 reasons:
1. incorrect transparant computation LCM data. We need to check VL operand defs and uses.
2. incorrect fusion of unrelated edge which is the edge never reach the vsetvl expression.

PR target/112855

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc
(pre_vsetvl::compute_lcm_local_properties): Fix transparant LCM data.
(pre_vsetvl::earliest_fuse_vsetvl_info): Disable earliest fusion for unrelated edge.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr112855.c: New test.
gcc/config/riscv/riscv-vsetvl.cc
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112855.c [new file with mode: 0644]