re PR target/55212 ([SH] Switch to LRA)

gcc/
	PR target/55212
	* config/sh/sh.md (*addsi3_compact): Emit reg-reg copy instead of
	constant load if constant operand fits into I08.

From-SVN: r219341
This commit is contained in:
Oleg Endo 2015-01-08 11:07:45 +00:00
parent bd84df1879
commit 3aa8dfe360
2 changed files with 14 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2015-01-08 Oleg Endo <olegendo@gcc.gnu.org>
PR target/55212
* config/sh/sh.md (*addsi3_compact): Emit reg-reg copy instead of
constant load if constant operand fits into I08.
2015-01-08 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/64336

View File

@ -2061,8 +2061,9 @@
;; The problem is that LRA expects something like
;; (set rA (plus rB (const_int N)))
;; to work. We can do that, but we have to split out an additional reg-reg
;; copy before the actual add insn. Use u constraint for that case to avoid
;; the invalid value in the stack pointer.
;; copy or constant load before the actual add insn.
;; Use u constraint for that case to avoid the invalid value in the stack
;; pointer.
(define_insn_and_split "*addsi3_compact"
[(set (match_operand:SI 0 "arith_reg_dest" "=r,&u")
(plus:SI (match_operand:SI 1 "arith_operand" "%0,r")
@ -2078,7 +2079,11 @@
&& ! reg_overlap_mentioned_p (operands[0], operands[1])"
[(set (match_dup 0) (match_dup 2))
(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))]
""
{
/* Prefer 'mov r0,r1; add #imm8,r1' over 'mov #imm8,r1; add r0,r1' */
if (satisfies_constraint_I08 (operands[2]))
std::swap (operands[1], operands[2]);
}
[(set_attr "type" "arith")])
;; -------------------------------------------------------------------------