summaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-20 23:18:44 +0000
committerm.hayes <m.hayes@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-20 23:18:44 +0000
commit845c2c00ddfddb4a175002739a554b1e5396414e (patch)
tree192ff04b90e438ebd750db43b8f416a6b9b064fa /gcc/config
parente70d38cdf457b2e97ff54c9c1121455b663c81f9 (diff)
downloadgcc-845c2c00ddfddb4a175002739a554b1e5396414e.tar.gz
* config/c4x/c4x.md: Add new peepholes to remove redundant loads.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26571 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/c4x/c4x.md23
1 files changed, 23 insertions, 0 deletions
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")