From patchwork Fri May 6 10:32:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 619249 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3r1SlY47Ygz9t3s for ; Fri, 6 May 2016 20:32:41 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=S/ZaPqOu; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=Q9w4vPgW+i3PuZV0/Rj7QVCiPQgAiyWoVqIMb1wcPeWOpM bqayKqOjhQZo2Pvy20uqIF44LZSOPfaDjz11lN4BZMDEt0B2K9vDBZ3iIOYcIUr2 Oc019DNpM/ea+Zfjz4FVXXquvnGgsDvcguot1ZvlB+4/tC403KeH8k+w26f6M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=pHnOXBrd3hLPgOgtWojdPD4PCfs=; b=S/ZaPqOu3TIkbKSarEPJ LD/CbJlAxm4JoOADosvoUqTNst5f7AmXp57xt46QytOXuXTIQyk5/s3Yz2rnA7qp 6Ylk6QfwtZzIev5ZBVFq30Uy0wLIGpZ/wLBAxkDH/X8wM2kgs+bOvV4IYDx6HLmp eJ+Ff9oncGCpX0dWulvWP2w= Received: (qmail 107580 invoked by alias); 6 May 2016 10:32:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 107564 invoked by uid 89); 6 May 2016 10:32:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mailout04.t-online.de Received: from mailout04.t-online.de (HELO mailout04.t-online.de) (194.25.134.18) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 06 May 2016 10:32:22 +0000 Received: from fwd09.aul.t-online.de (fwd09.aul.t-online.de [172.20.27.151]) by mailout04.t-online.de (Postfix) with SMTP id BAADFEF0B for ; Fri, 6 May 2016 12:32:17 +0200 (CEST) Received: from [192.168.0.16] (rfhekaZvwhGuRaf2UREoJzWWXoKhBFl4U16RbH0EdWBo26t9USPdB1miVD43-m5wnX@[115.165.93.200]) by fwd09.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1ayd3P-1l4upM0; Fri, 6 May 2016 12:32:15 +0200 Message-ID: <1462530733.3864.11.camel@t-online.de> Subject: [SH][committed] Remove some workaround combine patterns From: Oleg Endo To: gcc-patches Date: Fri, 06 May 2016 19:32:13 +0900 Mime-Version: 1.0 X-IsSubscribed: yes 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 --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