From: Andi Kleen <andi@firstfloor.org>
To: gcc-patches@gcc.gnu.org
Cc: Andi Kleen <ak@linux.intel.com>
Subject: [PATCH 1/2] Remove i386 cmpstrnsi peephole
Date: Fri, 04 Jul 2014 05:14:00 -0000 [thread overview]
Message-ID: <1404450822-15661-1-git-send-email-andi@firstfloor.org> (raw)
From: Andi Kleen <ak@linux.intel.com>
The peephole that removes the code to compute a tristate for cmpstrnsi
when only a boolean jump is needed never triggers in my tests. Just
remove it.
gcc/:
2014-07-02 Andi Kleen <ak@linux.intel.com>
* config/i386/i386.md: Remove peepholes for cmpstrn*.
---
gcc/config/i386/i386.md | 77 -------------------------------------------------
1 file changed, 77 deletions(-)
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 695b981..5f32a24 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -16078,83 +16078,6 @@
(const_string "0")
(const_string "*")))
(set_attr "prefix_rep" "1")])
-
-;; Peephole optimizations to clean up after cmpstrn*. This should be
-;; handled in combine, but it is not currently up to the task.
-;; When used for their truth value, the cmpstrn* expanders generate
-;; code like this:
-;;
-;; repz cmpsb
-;; seta %al
-;; setb %dl
-;; cmpb %al, %dl
-;; jcc label
-;;
-;; The intermediate three instructions are unnecessary.
-
-;; This one handles cmpstrn*_nz_1...
-(define_peephole2
- [(parallel[
- (set (reg:CC FLAGS_REG)
- (compare:CC (mem:BLK (match_operand 4 "register_operand"))
- (mem:BLK (match_operand 5 "register_operand"))))
- (use (match_operand 6 "register_operand"))
- (use (match_operand:SI 3 "immediate_operand"))
- (clobber (match_operand 0 "register_operand"))
- (clobber (match_operand 1 "register_operand"))
- (clobber (match_operand 2 "register_operand"))])
- (set (match_operand:QI 7 "register_operand")
- (gtu:QI (reg:CC FLAGS_REG) (const_int 0)))
- (set (match_operand:QI 8 "register_operand")
- (ltu:QI (reg:CC FLAGS_REG) (const_int 0)))
- (set (reg FLAGS_REG)
- (compare (match_dup 7) (match_dup 8)))
- ]
- "peep2_reg_dead_p (4, operands[7]) && peep2_reg_dead_p (4, operands[8])"
- [(parallel[
- (set (reg:CC FLAGS_REG)
- (compare:CC (mem:BLK (match_dup 4))
- (mem:BLK (match_dup 5))))
- (use (match_dup 6))
- (use (match_dup 3))
- (clobber (match_dup 0))
- (clobber (match_dup 1))
- (clobber (match_dup 2))])])
-
-;; ...and this one handles cmpstrn*_1.
-(define_peephole2
- [(parallel[
- (set (reg:CC FLAGS_REG)
- (if_then_else:CC (ne (match_operand 6 "register_operand")
- (const_int 0))
- (compare:CC (mem:BLK (match_operand 4 "register_operand"))
- (mem:BLK (match_operand 5 "register_operand")))
- (const_int 0)))
- (use (match_operand:SI 3 "immediate_operand"))
- (use (reg:CC FLAGS_REG))
- (clobber (match_operand 0 "register_operand"))
- (clobber (match_operand 1 "register_operand"))
- (clobber (match_operand 2 "register_operand"))])
- (set (match_operand:QI 7 "register_operand")
- (gtu:QI (reg:CC FLAGS_REG) (const_int 0)))
- (set (match_operand:QI 8 "register_operand")
- (ltu:QI (reg:CC FLAGS_REG) (const_int 0)))
- (set (reg FLAGS_REG)
- (compare (match_dup 7) (match_dup 8)))
- ]
- "peep2_reg_dead_p (4, operands[7]) && peep2_reg_dead_p (4, operands[8])"
- [(parallel[
- (set (reg:CC FLAGS_REG)
- (if_then_else:CC (ne (match_dup 6)
- (const_int 0))
- (compare:CC (mem:BLK (match_dup 4))
- (mem:BLK (match_dup 5)))
- (const_int 0)))
- (use (match_dup 3))
- (use (reg:CC FLAGS_REG))
- (clobber (match_dup 0))
- (clobber (match_dup 1))
- (clobber (match_dup 2))])])
\f
;; Conditional move instructions.
--
2.0.0
next reply other threads:[~2014-07-04 5:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-04 5:14 Andi Kleen [this message]
2014-07-04 5:14 ` [PATCH 2/2] Remove x86 cmpstrnsi Andi Kleen
2014-09-27 18:11 [PATCH 1/2] Remove i386 cmpstrnsi peephole Andi Kleen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1404450822-15661-1-git-send-email-andi@firstfloor.org \
--to=andi@firstfloor.org \
--cc=ak@linux.intel.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).