summaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-16 17:53:02 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2000-01-16 17:53:02 +0000
commita161d435a10c24b5e94eecf428202fd77369f28a (patch)
tree124fb7970fc89356797acbecf335d2f905cf4595 /gcc/config/i386
parente1ddff7076cf9eba3d4b0c73d84233c34803a814 (diff)
downloadgcc-a161d435a10c24b5e94eecf428202fd77369f28a.tar.gz
* config/i386/i386.md: Add peephole to merge successive stack
adjusts. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@31443 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.md19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 2f7aa6ab140..c7b01819a43 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -8947,6 +8947,25 @@
[(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]));")
;; Call-value patterns last so that the wildcard operand does not
;; disrupt insn-recog's switch tables.