* config/c4x/c4x.md: Add new peepholes to remove redundant loads.
authorMichael Hayes <m.hayes@gcc.gnu.org>
Tue, 20 Apr 1999 23:18:44 +0000 (23:18 +0000)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Tue, 20 Apr 1999 23:18:44 +0000 (23:18 +0000)
From-SVN: r26571

gcc/ChangeLog
gcc/config/c4x/c4x.md

index 353beffc3fda92e164b4cb025ce9641dd3554af1..416fce9601f9eb9245c291bd20e7db15ac81f494 100644 (file)
@@ -1,8 +1,14 @@
+Wed Apr 21 18:15:55 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
+
+       * config/c4x/c4x.md: Add new peepholes to remove redundant loads.
+
 Wed Apr 21 17:41:29 1999  Michael Hayes  <m.hayes@elec.canterbury.ac.nz>
 
        * 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  <nathan@acm.org>
+       instructions.
+
+Tue Apr 20 23:38:58 1999  Nathan Sidwell  <nathan@acm.org>
 
        * objc/Make-lang.in (objc-parse.c): Put BISON parameters in correct
        order.
index fc567f20e85d1291cafee29eff821493111d1249..0769556ced832c68b5d292cb7bda7728646c860d 100644 (file)
  "(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")