diff options
author | Juzhe-Zhong <juzhe.zhong@rivai.ai> | 2024-02-06 07:12:24 +0800 |
---|---|---|
committer | Pan Li <pan2.li@intel.com> | 2024-02-06 20:48:10 +0800 |
commit | d29136ad3282905145e24d7ec10b6efe4ab5d2f1 (patch) | |
tree | 14ed152692168daa300bd718e516acae07e4cb00 | |
parent | d3eac7d96de790df51859f63c13838f153b416de (diff) | |
download | gcc-d29136ad3282905145e24d7ec10b6efe4ab5d2f1.zip gcc-d29136ad3282905145e24d7ec10b6efe4ab5d2f1.tar.gz gcc-d29136ad3282905145e24d7ec10b6efe4ab5d2f1.tar.bz2 |
RISC-V: Fix infinite compilation of VSETVL PASS
This patch fixes issue reported by Jeff.
Testing is running. Ok for trunk if I passed the testing with no regression ?
gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc (pre_vsetvl::emit_vsetvl): Fix inifinite compilation.
(pre_vsetvl::remove_vsetvl_pre_insns): Ditto.
-rw-r--r-- | gcc/config/riscv/riscv-vsetvl.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 2c0dcdf..32f262d 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -2281,9 +2281,8 @@ private: } } - void remove_vsetvl_insn (const vsetvl_info &info) + void remove_vsetvl_insn (rtx_insn *rinsn) { - rtx_insn *rinsn = info.get_insn ()->rtl (); if (dump_file) { fprintf (dump_file, " Eliminate insn %d:\n", INSN_UID (rinsn)); @@ -3231,7 +3230,7 @@ pre_vsetvl::emit_vsetvl () if (curr_info.delete_p ()) { if (vsetvl_insn_p (insn->rtl ())) - remove_vsetvl_insn (curr_info); + remove_vsetvl_insn (curr_info.get_insn ()->rtl ()); continue; } else if (curr_info.valid_p ()) @@ -3269,7 +3268,7 @@ pre_vsetvl::emit_vsetvl () for (const vsetvl_info &item : m_delete_list) { gcc_assert (vsetvl_insn_p (item.get_insn ()->rtl ())); - remove_vsetvl_insn (item); + remove_vsetvl_insn (item.get_insn ()->rtl ()); } /* Insert vsetvl info that was not deleted after lift up. */ @@ -3434,7 +3433,7 @@ pre_vsetvl::remove_vsetvl_pre_insns () INSN_UID (rinsn)); print_rtl_single (dump_file, rinsn); } - remove_insn (rinsn); + remove_vsetvl_insn (rinsn); } } |