Commit a2a92083 by Richard Sandiford Committed by Richard Sandiford

recog.c (split_insn): Consider attaching a REG_EQUAL note to the final insn of a split.

gcc/
	* recog.c (split_insn): Consider attaching a REG_EQUAL note to the
	final insn of a split.

From-SVN: r139802
parent 8bcf15f6
2008-08-30 Richard Sandiford <rdsandiford@googlemail.com>
* recog.c (split_insn): Consider attaching a REG_EQUAL note to the
final insn of a split.
2008-08-30 Jan Hubicka <jh@suse.cz>
* postreload-gcse.c (gate_handle_gcse2): Disable for functions
......
......@@ -2630,10 +2630,29 @@ split_insn (rtx insn)
/* Split insns here to get max fine-grain parallelism. */
rtx first = PREV_INSN (insn);
rtx last = try_split (PATTERN (insn), insn, 1);
rtx insn_set, last_set, note;
if (last == insn)
return NULL_RTX;
/* If the original instruction was a single set that was known to be
equivalent to a constant, see if we can say the same about the last
instruction in the split sequence. The two instructions must set
the same destination. */
insn_set = single_set (insn);
if (insn_set)
{
last_set = single_set (last);
if (last_set && rtx_equal_p (SET_DEST (last_set), SET_DEST (insn_set)))
{
note = find_reg_equal_equiv_note (insn);
if (note && CONSTANT_P (XEXP (note, 0)))
set_unique_reg_note (last, REG_EQUAL, XEXP (note, 0));
else if (CONSTANT_P (SET_SRC (insn_set)))
set_unique_reg_note (last, REG_EQUAL, SET_SRC (insn_set));
}
}
/* try_split returns the NOTE that INSN became. */
SET_INSN_DELETED (insn);
......@@ -2651,6 +2670,7 @@ split_insn (rtx insn)
first = NEXT_INSN (first);
}
}
return last;
}
......
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