diff mbox

[1/2] Remove i386 cmpstrnsi peephole

Message ID 1411841447-20914-1-git-send-email-andi@firstfloor.org
State New
Headers show

Commit Message

Andi Kleen Sept. 27, 2014, 6:10 p.m. UTC
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-09-27  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 mbox

Patch

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 004302d..98df8e1 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -16297,83 +16297,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))])])
 
 ;; Conditional move instructions.