diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 353beffc3fd..416fce9601f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,8 +1,14 @@ +Wed Apr 21 18:15:55 1999 Michael Hayes + + * config/c4x/c4x.md: Add new peepholes to remove redundant loads. + Wed Apr 21 17:41:29 1999 Michael Hayes * config/c4x/c4x.md (binary patterns): Reorder alternatives so that two operand instructions are chosen before three operand - instructions.Tue Apr 20 23:38:58 1999 Nathan Sidwell + instructions. + +Tue Apr 20 23:38:58 1999 Nathan Sidwell * objc/Make-lang.in (objc-parse.c): Put BISON parameters in correct order. diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md index fc567f20e85..0769556ced8 100644 --- a/gcc/config/c4x/c4x.md +++ b/gcc/config/c4x/c4x.md @@ -7101,3 +7101,26 @@ "(REGNO (operands[0]) != REGNO (operands[4]))" "xor3\\t%2,%1,%0\\n||\\tsti\\t%4,%3") +; The following two peepholes remove an unecessary load +; often found at the end of a function. These peepholes +; could be generalised to other binary operators. They shouldn't +; be required if we run a post reload mop-up pass. +(define_peephole + [(parallel [(set (match_operand:QF 0 "ext_reg_operand" "") + (plus:QF (match_operand:QF 1 "ext_reg_operand" "") + (match_operand:QF 2 "ext_reg_operand" ""))) + (clobber (reg:CC_NOOV 21))]) + (set (match_operand:QF 3 "ext_reg_operand" "") + (match_dup 0))] + "dead_or_set_p (insn, operands[0])" + "addf3\\t%2,%1,%3") + +(define_peephole + [(parallel [(set (match_operand:QI 0 "reg_operand" "") + (plus:QI (match_operand:QI 1 "reg_operand" "") + (match_operand:QI 2 "reg_operand" ""))) + (clobber (reg:CC_NOOV 21))]) + (set (match_operand:QI 3 "reg_operand" "") + (match_dup 0))] + "dead_or_set_p (insn, operands[0])" + "addi3\\t%2,%1,%3")