From patchwork Thu Nov 11 11:24:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1553901 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=Bnpz1Z3x; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HqfsP2bnwz9sCD for ; Thu, 11 Nov 2021 22:40:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 124E13857C7C for ; Thu, 11 Nov 2021 11:40:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 124E13857C7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1636630807; bh=oH0jRPSuq+wvdf8YJR/BWPF/0M+pDd/2z0Cex073vng=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Bnpz1Z3xfsnrtR2gyP//yRk+jEWe3c6+p37TleFzaqEYwhQTrgGDfTb23e3acjYXA 9VQF6z/Mn5PTADD0dgOLxYsPZrawEhrb6Szv9uQLXGvw/ka1xzLDWwOTZMLMwqu7Uf mraNzskP/PbcxTzW8E59xCocRLQJW+vbn3sGy5fw= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 3395F385803B for ; Thu, 11 Nov 2021 11:25:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3395F385803B Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1ABAuUOB003999; Thu, 11 Nov 2021 11:25:24 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3c900y456u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Nov 2021 11:25:23 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1ABBPNPS020245; Thu, 11 Nov 2021 11:25:23 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3c900y455y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Nov 2021 11:25:23 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1ABBP817005136; Thu, 11 Nov 2021 11:25:21 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03ams.nl.ibm.com with ESMTP id 3c5hbaw0n2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Nov 2021 11:25:21 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1ABBPJEi54788414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Nov 2021 11:25:19 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D82144C044; Thu, 11 Nov 2021 11:25:18 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 22E464C04E; Thu, 11 Nov 2021 11:25:18 +0000 (GMT) Received: from trout.aus.stglabs.ibm.com (unknown [9.40.194.100]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Nov 2021 11:25:17 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH 11/15] csky: Fix non-robust split condition in define_insn_and_split Date: Thu, 11 Nov 2021 05:24:55 -0600 Message-Id: <11a7f2d5b98c5dadd6401acf196b02440439b63f.1636621345.git.linkw@linux.ibm.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: PIwUVvqU61Ro3BM85YsQtWtA6eLOEK2b X-Proofpoint-ORIG-GUID: OglZ1HtGmQjgZDxfmYzIhZ80hAoeK_Bv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-11_03,2021-11-08_02,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 malwarescore=0 adultscore=0 clxscore=1011 mlxscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 phishscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2111110066 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kewen Lin via Gcc-patches From: "Kewen.Lin" Reply-To: Kewen Lin Cc: xianmiao_qu@c-sky.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" This patch is to fix some non-robust split conditions in some define_insn_and_splits, to make each of them applied on top of the corresponding condition for define_insn part, otherwise the splitting could perform unexpectedly. gcc/ChangeLog: * config/csky/csky.md (*cskyv2_adddi3, *ck801_adddi3, *cskyv2_adddi1_1, *cskyv2_subdi3, *ck801_subdi3, *cskyv2_subdi1_1, cskyv2_addcc, cskyv2_addcc_invert, *cskyv2_anddi3, *ck801_anddi3, *cskyv2_iordi3, *ck801_iordi3, *cskyv2_xordi3, *ck801_xordi3,): Fix split condition. --- gcc/config/csky/csky.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/gcc/config/csky/csky.md b/gcc/config/csky/csky.md index f91d851cb2c..54143a0efea 100644 --- a/gcc/config/csky/csky.md +++ b/gcc/config/csky/csky.md @@ -850,7 +850,7 @@ (define_insn_and_split "*cskyv2_adddi3" (clobber (reg:CC CSKY_CC_REGNUM))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -877,7 +877,7 @@ (define_insn_and_split "*ck801_adddi3" (clobber (reg:CC CSKY_CC_REGNUM))] "CSKY_ISA_FEATURE (E1)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -906,7 +906,7 @@ (define_insn_and_split "*cskyv2_adddi1_1" (clobber (reg:CC CSKY_CC_REGNUM))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1048,7 +1048,7 @@ (define_insn_and_split "*cskyv2_subdi3" (clobber (reg:CC CSKY_CC_REGNUM))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1075,7 +1075,7 @@ (define_insn_and_split "*ck801_subdi3" (clobber (reg:CC CSKY_CC_REGNUM))] "CSKY_ISA_FEATURE (E1)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1104,7 +1104,7 @@ (define_insn_and_split "*cskyv2_subdi1_1" (clobber (reg:CC CSKY_CC_REGNUM))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1276,7 +1276,7 @@ (define_insn_and_split "cskyv2_addcc" dect\t%0, %1, %M2 # #" - "reload_completed && !rtx_equal_p (operands[0], operands[1])" + "&& reload_completed && !rtx_equal_p (operands[0], operands[1])" [(set (match_dup 0) (if_then_else:SI (ne (reg:CC CSKY_CC_REGNUM) (const_int 0)) (plus:SI (match_dup 0) (match_dup 2))))] @@ -1302,7 +1302,7 @@ (define_insn_and_split "cskyv2_addcc_invert" decf\t%0, %1, %M2 # #" - "reload_completed && !rtx_equal_p (operands[0], operands[1])" + "&& reload_completed && !rtx_equal_p (operands[0], operands[1])" [(set (match_dup 0) (if_then_else:SI (eq (reg:CC CSKY_CC_REGNUM) (const_int 0)) (plus:SI (match_dup 0) (match_dup 2))))] @@ -1691,7 +1691,7 @@ (define_insn_and_split "*cskyv2_anddi3" (match_operand:DI 2 "register_operand" "b,r")))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1716,7 +1716,7 @@ (define_insn_and_split "*ck801_anddi3" (match_operand:DI 2 "register_operand" "r")))] "CSKY_ISA_FEATURE (E1)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1801,7 +1801,7 @@ (define_insn_and_split "*cskyv2_iordi3" (match_operand:DI 2 "register_operand" "b, r")))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1826,7 +1826,7 @@ (define_insn_and_split "*ck801_iordi3" (match_operand:DI 2 "register_operand" "r")))] "CSKY_ISA_FEATURE (E1)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1911,7 +1911,7 @@ (define_insn_and_split "*cskyv2_xordi3" (match_operand:DI 2 "register_operand" "b, r")))] "CSKY_ISA_FEATURE (E2)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD; @@ -1936,7 +1936,7 @@ (define_insn_and_split "*ck801_xordi3" (match_operand:DI 2 "register_operand" "r")))] "CSKY_ISA_FEATURE (E1)" "#" - "reload_completed" + "&& reload_completed" [(const_int 0)] { int hi = TARGET_BIG_ENDIAN ? 0 : UNITS_PER_WORD;