]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Add function comment for cleanup_insns.
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Sun, 23 Apr 2023 11:33:54 +0000 (19:33 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 24 Apr 2023 06:18:29 +0000 (14:18 +0800)
Add more comment for cleanup_insns.

gcc/ChangeLog:

* config/riscv/riscv-vsetvl.cc (pass_vsetvl::pre_vsetvl): Add function
comment for cleanup_insns.

gcc/config/riscv/riscv-vsetvl.cc

index ac99028df431140106f0b24e7204d26d4a6d8215..fa68b8a04625d5c61d0f9db398f058918e7fd54f 100644 (file)
@@ -3998,6 +3998,21 @@ pass_vsetvl::pre_vsetvl (void)
     commit_edge_insertions ();
 }
 
+/* Before VSETVL PASS, RVV instructions pattern is depending on AVL operand
+   implicitly. Since we will emit VSETVL instruction and make RVV instructions
+   depending on VL/VTYPE global status registers, we remove the such AVL operand
+   in the RVV instructions pattern here in order to remove AVL dependencies when
+   AVL operand is a register operand.
+
+   Before the VSETVL PASS:
+     li a5,32
+     ...
+     vadd.vv (..., a5)
+   After the VSETVL PASS:
+     li a5,32
+     vsetvli zero, a5, ...
+     ...
+     vadd.vv (..., const_int 0).  */
 void
 pass_vsetvl::cleanup_insns (void) const
 {