committed, thanks. On Tue, Jan 10, 2023 at 7:17 AM wrote: > From: Ju-Zhe Zhong > > Notice that the PASS is just simpily pick the probability >= 50% > to do the backward fusion which will create endless loop on Phase 3. > > Adding this probability to fix this bug. > gcc/ChangeLog: > > * config/riscv/riscv-vsetvl.cc > (vector_infos_manager::vector_infos_manager): Add probability. > (vector_infos_manager::dump): Ditto. > (pass_vsetvl::compute_probabilities): Ditto. > * config/riscv/riscv-vsetvl.h (struct vector_block_info): Ditto. > > --- > gcc/config/riscv/riscv-vsetvl.cc | 39 ++++++++++++++++++++++++++++++++ > gcc/config/riscv/riscv-vsetvl.h | 3 +++ > 2 files changed, 42 insertions(+) > > diff --git a/gcc/config/riscv/riscv-vsetvl.cc > b/gcc/config/riscv/riscv-vsetvl.cc > index 0f12d4ddb23..7d8c3a32aaa 100644 > --- a/gcc/config/riscv/riscv-vsetvl.cc > +++ b/gcc/config/riscv/riscv-vsetvl.cc > @@ -1465,6 +1465,7 @@ vector_infos_manager::vector_infos_manager () > vector_block_infos[bb->index ()].reaching_out = vector_insn_info > (); > for (insn_info *insn : bb->real_insns ()) > vector_insn_infos[insn->uid ()].parse_insn (insn); > + vector_block_infos[bb->index ()].probability = > profile_probability (); > } > } > } > @@ -1642,6 +1643,8 @@ vector_infos_manager::dump (FILE *file) const > } > fprintf (file, "