+2018-11-21 Uros Bizjak <ubizjak@gmail.com>
+
+ Revert the revert:
+ 2013-10-26 Vladimir Makarov <vmakarov@redhat.com>
+
+ Revert:
+ 2013-10-25 Vladimir Makarov <vmakarov@redhat.com>
+
+ * lra-spills.c (lra_final_code_change): Remove useless move insns.
+
2018-11-21 Uros Bizjak <ubizjak@gmail.com>
PR middle-end/88129
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++)
}
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);
+ }
}
}