On 7/10/23 02:12, juzhe.zh...@rivai.ai wrote:
From: Ju-Zhe Zhong <juzhe.zh...@rivai.ai>

Since VSETVL PASS in RISC-V port is using common part of 
'insert_insn_end_basic_block (struct gcse_expr *expr, basic_block bb)'
and we will also this helper function in riscv.cc for the following patches.

So extract the common part codes of 'insert_insn_end_basic_block (struct 
gcse_expr *expr, basic_block bb)', the new function
of the common part is also call 'insert_insn_end_basic_block (rtx_insn *pat, 
basic_block bb)' but with different arguments.
And call 'insert_insn_end_basic_block (rtx_insn *pat, basic_block bb)' in 
'insert_insn_end_basic_block (struct gcse_expr *expr, basic_block bb)'
and VSETVL PASS in RISC-V port.

Remove redundant codes of VSETVL PASS in RISC-V port.

gcc/ChangeLog:

         * config/riscv/riscv-vsetvl.cc (add_label_notes): Remove it.
         (insert_insn_end_basic_block): Ditto.
         (pass_vsetvl::commit_vsetvls): Adapt for new helper function.
         * gcse.cc (insert_insn_end_basic_block):  Export as global function.
         * gcse.h (insert_insn_end_basic_block): Ditto.
OK.  Thanks for remembering to clean this up.

jeff

Reply via email to