From 1008df90cca4a4f49f2a898115f8756fafff3187 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 29 Apr 2019 16:18:55 +0200 Subject: re PR rtl-optimization/90257 (8% degradation on cpu2006 403.gcc starting with r270484) PR rtl-optimization/90257 * cfgrtl.c (flow_active_insn_p): Return true for USE of a function return value. Revert the revert: 2019-04-21 H.J. Lu PR target/90178 Revert: 2018-11-21 Uros Bizjak Revert the revert: 2013-10-26 Vladimir Makarov Revert: 2013-10-25 Vladimir Makarov * lra-spills.c (lra_final_code_change): Remove useless move insns. From-SVN: r270653 --- gcc/lra-spills.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'gcc/lra-spills.c') diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index 18db79e7..c19b76a 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -740,6 +740,7 @@ lra_final_code_change (void) int i, hard_regno; basic_block bb; rtx_insn *insn, *curr; + rtx set; int max_regno = max_reg_num (); for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) @@ -818,5 +819,19 @@ lra_final_code_change (void) } if (insn_change_p) lra_update_operator_dups (id); + + if ((set = single_set (insn)) != NULL + && REG_P (SET_SRC (set)) && REG_P (SET_DEST (set)) + && REGNO (SET_SRC (set)) == REGNO (SET_DEST (set))) + { + /* Remove an useless move insn. IRA can generate move + insns involving pseudos. It is better remove them + earlier to speed up compiler a bit. It is also + better to do it here as they might not pass final RTL + check in LRA, (e.g. insn moving a control register + into itself). */ + lra_invalidate_insn_data (insn); + delete_insn (insn); + } } } -- cgit v1.1