diff mbox

[SH,committed] Remove some workaround combine patterns

Message ID 1462530733.3864.11.camel@t-online.de
State New
Headers show

Commit Message

Oleg Endo May 6, 2016, 10:32 a.m. UTC
Hi,

The attached patch removes some workaround combine patterns.  As far as
I remember this issue has been addressed by some match.pd patterns.  In
any case, CSiBE code size shows no difference and the SH specific
testcases mentioned in the code pass without the patterns.

Tested on sh-elf with

make -k check RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb,
-m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}"

Committed as r235956.

Cheers,
Oleg

gcc/ChangeLog:
	* config/sh/sh.md (*cmpeqsi_t): Remove combine insn pattern and similar
	corresponding combine split pattern.
diff mbox

Patch

diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index b054c9e..f606e29 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -909,22 +909,6 @@ 
   FAIL;
 })
 
-;; FIXME: For some reason, on SH4A and SH2A combine fails to simplify this
-;; pattern by itself.  What this actually does is:
-;;	x == 0: (1 >> 0-0) & 1 = 1
-;;	x != 0: (1 >> 0-x) & 1 = 0
-;; Without this the test pr51244-8.c fails on SH2A and SH4A.
-(define_insn_and_split "*cmpeqsi_t"
-  [(set (reg:SI T_REG)
-	(and:SI (lshiftrt:SI
-		  (const_int 1)
-		  (neg:SI (match_operand:SI 0 "arith_reg_operand" "r")))
-		(const_int 1)))]
-  "TARGET_SH1"
-  "#"
-  "&& 1"
-  [(set (reg:SI T_REG) (eq:SI (match_dup 0) (const_int 0)))])
-
 (define_insn "cmpgtsi_t"
   [(set (reg:SI T_REG)
 	(gt:SI (match_operand:SI 0 "arith_reg_operand" "r,r")
@@ -1229,29 +1213,6 @@ 
 			   (label_ref (match_dup 2))
 			   (pc)))])
 
-;; FIXME: Similar to the *cmpeqsi_t pattern above, for some reason, on SH4A
-;; and SH2A combine fails to simplify this pattern by itself.
-;; What this actually does is:
-;;	x == 0: (1 >> 0-0) & 1 = 1
-;;	x != 0: (1 >> 0-x) & 1 = 0
-;; Without this the test pr51244-8.c fails on SH2A and SH4A.
-(define_split
-  [(set (pc)
-	(if_then_else
-	  (eq (and:SI (lshiftrt:SI
-			(const_int 1)
-			(neg:SI (match_operand:SI 0 "arith_reg_operand" "")))
-		      (const_int 1))
-	      (const_int 0))
-	  (label_ref (match_operand 2))
-	  (pc)))
-   (clobber (reg:SI T_REG))]
-  "TARGET_SH1"
-  [(set (reg:SI T_REG) (eq:SI (match_dup 0) (const_int 0)))
-   (set (pc) (if_then_else (eq (reg:SI T_REG) (const_int 0))
-			   (label_ref (match_dup 2))
-			   (pc)))])
-
 ;; FIXME: These don't seem to have any effect on the generated cbranch code
 ;;	  anymore, but only on some register allocation choices.
 (define_split