@@ -5777,6 +5777,41 @@
(const_string "none")))
(set_attr "mode" "QI")])
+;; Split non destructive adds if we cannot use lea.
+(define_split
+ [(set (match_operand:SWI48 0 "register_operand" "")
+ (plus:SWI48 (match_operand:SWI48 1 "register_operand" "")
+ (match_operand:SWI48 2 "nonmemory_operand" "")))
+ (clobber (reg:CC FLAGS_REG))]
+ "reload_completed && ix86_avoid_lea_for_add (insn, operands)"
+ [(set (match_dup 0) (match_dup 1))
+ (parallel [(set (match_dup 0) (plus:<MODE> (match_dup 0) (match_dup 2)))
+ (clobber (reg:CC FLAGS_REG))])
+ ]
+)
Put all closing braces on one line:
(clobber (reg:CC FLAGS_REG))])])
+;; Split lea into one or more ALU instructions if profitable.
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (subreg:SI (match_operand:DI 1 "lea_address_operand" "") 0))]
+ "reload_completed && ix86_avoid_lea_for_addr (insn, operands)"
+ [(const_int 0)]
+{
+ ix86_split_lea_for_addr (operands, SImode);
+ DONE;
+})
This is valid only for TARGET_64BIT.
Please note that x32 adds quite some different LEA patterns (see
i386.md, line 5466+). I suggest you merge your splitters with these
define_insn patterns into define_insn_and_split, adding "&&
reload_completed && ix86_avoid_lea_for_addr (insn, operands)" as a
split condition.
Uros.