Commit 4dbf3a15 by Chenghua Xu Committed by Chenghua Xu

[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
parent 98aaa1a6
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> 2019-05-14 Bin Cheng <bin.cheng@linux.alibaba.com>
* gimple-ssa-strength-reduction.c (lookup_cand): Adjust index by 1. * gimple-ssa-strength-reduction.c (lookup_cand): Adjust index by 1.
......
...@@ -4849,6 +4849,7 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_) ...@@ -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 can forward SRC for DEST. This is most useful if the next insn is a
simple store. */ simple store. */
rtx_insn *insn = (rtx_insn *)insn_; rtx_insn *insn = (rtx_insn *)insn_;
struct mips_address_info addr;
if (insn) if (insn)
{ {
rtx_insn *next = next_nonnote_nondebug_insn_bb (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_) ...@@ -4856,7 +4857,17 @@ mips_split_move (rtx dest, rtx src, enum mips_split_type split_type, rtx insn_)
{ {
rtx set = single_set (next); rtx set = single_set (next);
if (set && SET_SRC (set) == dest) 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);
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment