;; When optimizing for size, zeroing memory should use a register.
(define_peephole2
[(match_scratch:SWI48 0 "r")
- (set (match_operand:SWI48 1 "memory_operand" "") (const_int 0))
- (set (match_operand:SWI48 2 "memory_operand" "") (const_int 0))
- (set (match_operand:SWI48 3 "memory_operand" "") (const_int 0))
- (set (match_operand:SWI48 4 "memory_operand" "") (const_int 0))]
+ (set (match_operand:SWI48 1 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 2 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 3 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 4 "memory_operand") (const_int 0))]
"optimize_insn_for_size_p () && peep2_regno_dead_p (0, FLAGS_REG)"
- [(set (match_dup 1) (match_dup 0))
- (set (match_dup 2) (match_dup 0))
- (set (match_dup 3) (match_dup 0))
- (set (match_dup 4) (match_dup 0))]
+ [(const_int 0)]
{
ix86_expand_clear (operands[0]);
+ emit_move_insn (operands[1], operands[0]);
+ emit_move_insn (operands[2], operands[0]);
+ emit_move_insn (operands[3], operands[0]);
+ ix86_last_zero_store_uid
+ = INSN_UID (emit_move_insn (operands[4], operands[0]));
+ DONE;
})
(define_peephole2
[(match_scratch:SWI48 0 "r")
- (set (match_operand:SWI48 1 "memory_operand" "") (const_int 0))
- (set (match_operand:SWI48 2 "memory_operand" "") (const_int 0))]
+ (set (match_operand:SWI48 1 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 2 "memory_operand") (const_int 0))]
"optimize_insn_for_size_p () && peep2_regno_dead_p (0, FLAGS_REG)"
- [(set (match_dup 1) (match_dup 0))
- (set (match_dup 2) (match_dup 0))]
+ [(const_int 0)]
{
ix86_expand_clear (operands[0]);
+ emit_move_insn (operands[1], operands[0]);
+ ix86_last_zero_store_uid
+ = INSN_UID (emit_move_insn (operands[2], operands[0]));
+ DONE;
})
(define_peephole2
[(match_scratch:SWI48 0 "r")
- (set (match_operand:SWI48 1 "memory_operand" "") (const_int 0))]
+ (set (match_operand:SWI48 1 "memory_operand") (const_int 0))]
"optimize_insn_for_size_p () && peep2_regno_dead_p (0, FLAGS_REG)"
- [(set (match_dup 1) (match_dup 0))]
+ [(const_int 0)]
{
ix86_expand_clear (operands[0]);
+ ix86_last_zero_store_uid
+ = INSN_UID (emit_move_insn (operands[1], operands[0]));
+ DONE;
+})
+
+(define_peephole2
+ [(set (match_operand:SWI48 5 "memory_operand")
+ (match_operand:SWI48 0 "general_reg_operand"))
+ (set (match_operand:SWI48 1 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 2 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 3 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 4 "memory_operand") (const_int 0))]
+ "optimize_insn_for_size_p ()
+ && INSN_UID (peep2_next_insn (0)) == ix86_last_zero_store_uid"
+ [(const_int 0)]
+{
+ emit_move_insn (operands[5], operands[0]);
+ emit_move_insn (operands[1], operands[0]);
+ emit_move_insn (operands[2], operands[0]);
+ emit_move_insn (operands[3], operands[0]);
+ ix86_last_zero_store_uid
+ = INSN_UID (emit_move_insn (operands[4], operands[0]));
+ DONE;
+})
+
+(define_peephole2
+ [(set (match_operand:SWI48 3 "memory_operand")
+ (match_operand:SWI48 0 "general_reg_operand"))
+ (set (match_operand:SWI48 1 "memory_operand") (const_int 0))
+ (set (match_operand:SWI48 2 "memory_operand") (const_int 0))]
+ "optimize_insn_for_size_p ()
+ && INSN_UID (peep2_next_insn (0)) == ix86_last_zero_store_uid"
+ [(const_int 0)]
+{
+ emit_move_insn (operands[3], operands[0]);
+ emit_move_insn (operands[1], operands[0]);
+ ix86_last_zero_store_uid
+ = INSN_UID (emit_move_insn (operands[2], operands[0]));
+ DONE;
+})
+
+(define_peephole2
+ [(set (match_operand:SWI48 2 "memory_operand")
+ (match_operand:SWI48 0 "general_reg_operand"))
+ (set (match_operand:SWI48 1 "memory_operand") (const_int 0))]
+ "optimize_insn_for_size_p ()
+ && INSN_UID (peep2_next_insn (0)) == ix86_last_zero_store_uid"
+ [(const_int 0)]
+{
+ emit_move_insn (operands[2], operands[0]);
+ ix86_last_zero_store_uid
+ = INSN_UID (emit_move_insn (operands[1], operands[0]));
+ DONE;
})
;; Reload dislikes loading constants directly into class_likely_spilled