[MIPS] Skip forward src into next insn when the SRC reg is dead.

PR target/90357
	gcc/
	* config/mips/mips.c (mips_split_move): Skip forward SRC into
	next insn when the SRC reg is dead.

From-SVN: r271146
This commit is contained in:
Chenghua Xu 2019-05-14 01:42:59 +00:00 committed by Chenghua Xu
parent 98aaa1a633
commit 4dbf3a15f1
2 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2019-05-14 Chenghua Xu <paul.hua.gm@gmail.com>
PR target/90357
* config/mips/mips.c (mips_split_move): Skip forward SRC into
next insn when the SRC reg is dead.
2019-05-14 Bin Cheng <bin.cheng@linux.alibaba.com>
* gimple-ssa-strength-reduction.c (lookup_cand): Adjust index by 1.

View file

@ -4849,6 +4849,7 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
can forward SRC for DEST. This is most useful if the next insn is a
simple store. */
rtx_insn *insn = (rtx_insn *)insn_;
struct mips_address_info addr;
if (insn)
{
rtx_insn *next = next_nonnote_nondebug_insn_bb (insn);
@ -4856,7 +4857,17 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
{
rtx set = single_set (next);
if (set && SET_SRC (set) == dest)
validate_change (next, &SET_SRC (set), src, false);
{
if (MEM_P (src))
{
rtx tmp = XEXP (src, 0);
mips_classify_address (&addr, tmp, GET_MODE (tmp), true);
if (REGNO (addr.reg) != REGNO (dest))
validate_change (next, &SET_SRC (set), src, false);
}
else
validate_change (next, &SET_SRC (set), src, false);
}
}
}
}