diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-30 13:12:16 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-30 13:12:16 +0000 |
commit | 2ec3e1bb0136feabc25a40005826f1269ad2912b (patch) | |
tree | c70903997f961b8c258ea908d386a9c3ef689cff /gcc/recog.c | |
parent | 7baffbd38d2e4687a7d7f8e5382d82c778567231 (diff) | |
download | gcc-2ec3e1bb0136feabc25a40005826f1269ad2912b.tar.gz |
gcc/
* recog.c (split_insn): Consider attaching a REG_EQUAL note to the
final insn of a split.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139802 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 44d3b40b643..8da4e205f7d 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -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; } |