i386.md: Add peephole to merge successive stack adjusts.
authorZack Weinberg <zack@wolery.cumb.org>
Sun, 16 Jan 2000 17:53:02 +0000 (17:53 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Sun, 16 Jan 2000 17:53:02 +0000 (17:53 +0000)
* config/i386/i386.md: Add peephole to merge successive stack
adjusts.

From-SVN: r31443

gcc/ChangeLog
gcc/config/i386/i386.md

index 3041ab04f49bb4f49cdc073079d124a9a8538840..62c417c90225b738d366bc03cf87537842c17e14 100644 (file)
@@ -1,3 +1,8 @@
+2000-01-16  Zack Weinberg  <zack@wolery.cumb.org>
+
+       * config/i386/i386.md: Add peephole to merge successive stack
+       adjusts. 
+
 Sat Jan 15 15:41:14 EST 2000  John Wehle  (john@feith.com)
 
        * gcse.c (insert_insn_end_bb): Use emit_block_insn_before
index 2f7aa6ab140e1d2b5aedb21d72ea347ad7f8f12c..c7b01819a434a336e5df21047e6701b582452029 100644 (file)
   [(parallel [(set (match_dup 0) (ashift:SI (match_dup 0) (match_dup 2)))
              (clobber (reg:CC 17))])]
   "operands[2] = GEN_INT (exact_log2 (INTVAL (operands[1])));")
+
+;; Merge two successive stack adjusts.  The combiner doesn't know how
+;; to do this, and doesn't see all of them.
+;; (reg:SI 7) is %esp.
+(define_peephole2
+  [(parallel[
+    (set (reg:SI 7)
+        (plus:SI (reg:SI 7) (match_operand:SI 0 "const_int_operand" "")))
+    (clobber (reg:CC 17))])
+   (parallel[
+    (set (reg:SI 7)
+        (plus:SI (reg:SI 7) (match_operand:SI 1 "const_int_operand" "")))
+    (clobber (reg:CC 17))])]
+  ""
+  [(parallel[
+    (set (reg:SI 7)
+        (plus:SI (reg:SI 7) (match_dup 2)))
+    (clobber (reg:CC 17))])]
+  "operands[2] = GEN_INT (INTVAL (operands[0]) + INTVAL (operands[1]));")
 \f
 ;; Call-value patterns last so that the wildcard operand does not
 ;; disrupt insn-recog's switch tables.