aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-loop-manip.cc
diff options
context:
space:
mode:
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>2023-07-03 20:33:42 +0800
committerPan Li <pan2.li@intel.com>2023-07-04 10:48:37 +0800
commitc26f275861378cb4e339563b22e06cc8e2dc8120 (patch)
treef5d21be0437d71f6741b934687d792110d58b9af /gcc/tree-vect-loop-manip.cc
parent48c85cb5334df621a05b322661089dd08be27094 (diff)
downloadgcc-c26f275861378cb4e339563b22e06cc8e2dc8120.zip
gcc-c26f275861378cb4e339563b22e06cc8e2dc8120.tar.gz
gcc-c26f275861378cb4e339563b22e06cc8e2dc8120.tar.bz2
RISC-V: Optimize local AVL propagation
I recently noticed that current VSETVL pass has a unnecessary restriction on local AVL propgation. Consider this following case: + insn 1: vsetvli a5,a3,e8,mf4,ta,mu + insn 2: vsetvli zero,a5,e32,m1,ta,ma + ... + vle32.v v1,0(a1) + vsetvli a2,zero,e32,m1,ta,ma + vadd.vv v1,v1,v1 + vsetvli zero,a5,e32,m1,ta,ma + vse32.v v1,0(a0) + ... + insn 3: sub a3,a3,a5 + ... We failed to elide insn 2 (vsetvl insn) since insn 3 is modifying "a3" AVL. Actually, we don't really care about insn 3 since we should only check and make sure there is no insn between insn 1 and insn 2 that modifies "a3" AVL. Then, we can propgate AVL "a3" from insn 1 to insn 2. Finally, insn 2 is eliminated. After this patch: + insn 1: vsetvli a5,a3,e8,mf4,ta,ma + ... + vle32.v v1,0(a1) + vsetvli a2,zero,e32,m1,ta,ma + vadd.vv v1,v1,v1 + vsetvli zero,a5,e32,m1,ta,ma + vse32.v v1,0(a0) + ... + insn 3: sub a3,a3,a5 + ... gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (vector_insn_info::parse_insn): Add early break. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/vsetvl/avl_prop-1.c: New test.
Diffstat (limited to 'gcc/tree-vect-loop-manip.cc')
0 files changed, 0 insertions, 0 deletions