Message ID | 20220812063959.151705-1-guojiufu@linux.ibm.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:38f:b0:2d5:3c95:9e21 with SMTP id 15csp678028pxh; Thu, 11 Aug 2022 23:40:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR4tGhmtFfAmoDVIkRZwFyyf88cSMbgzUIlXhAoffZe6H+9j+5letiGhm/j5L3EUadn07L3k X-Received: by 2002:a17:907:a218:b0:731:2b2b:f34 with SMTP id qp24-20020a170907a21800b007312b2b0f34mr1763170ejc.404.1660286456667; Thu, 11 Aug 2022 23:40:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660286456; cv=none; d=google.com; s=arc-20160816; b=sQ08yxjbp4J7jSwyjmu9j9u17TUQuoqVZn/XI+SYG2xbv1gb4XxxbYEbAyP4WcmFIE +HZrylxzHhBf6QRn2yJrmGaBmwxnIxiCHLt8qU8Sw9XlfEE2/J8gfoAUxFcUmACtM022 tbBnzOuDaWFniapBaXkWsJhlzMY0AHYscanIOef5h4dmkzpUzLujaktPbmiPvp25gmZ6 WSre/YbZ6LpbRlbwuPJPh2dfqP9deCq8QkMAQHEpDTlC+hsTr07jFtAR+/MTXO3R6k32 F7BRUQfNxjbUdUN4s9piLdnLW4gaLMX6zDY8ZegwwYCaKSEjTrrbT/kpljzuCSFbuVrf Zulg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=YpU+FxRlXeZblfVoWpzn7j+9o6ghGOAUowlwlfx8CiU=; b=dZ20i5ME6G9OKj/R9bk8xfaezPD/zrhDQoQWBAsGzrZHb6Dya3wpPxeCAI8KVHb78k aRxZYx7frnqSHPYjp2mRR816HVrnwjqJt91+z3FyY23bkC/9JhxKkAfq2CvtHaf6pVHC r/YSB5XLQAEv5jiB9JEcU9jw7UCzBIf+g1pdmGHL8EjZ+RM8tk9wjIg/1Biw6a9kUSLi nLLLyXP/+bgMpcyICB4WVFnXWfsApPsNMj8oGl/HNKFjrvOL+oBkZpcdTPHICsgAJ6vA 4j4OpS01vAz0J8UNKvyF+Cu55iO45ANGeJOa3H+wECD5hJVlOtlM6n48sCePEeBEOBts KbHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SmxQpnEP; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id m10-20020a056402430a00b0043aa8412572si1710161edc.257.2022.08.11.23.40.56 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Aug 2022 23:40:56 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=SmxQpnEP; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C688B3858282 for <ouuuleilei@gmail.com>; Fri, 12 Aug 2022 06:40:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C688B3858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1660286450; bh=YpU+FxRlXeZblfVoWpzn7j+9o6ghGOAUowlwlfx8CiU=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=SmxQpnEP5kD6b3ZzZ6oeGZ091Y4m6IFUvliqWjdf+N5QDTngrduVS8DvGbYMU9N3M F6MeysXA3Lss7hqs1rn0ALiZiV/911E8C1Ic1VUsmxJoYdxbUInVddmVQ3ZyMcLR90 68+n6yulm77oUYabDKvjRs0D3lH04Xt9Ftq3x8Pw= 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 8161F3858D28; Fri, 12 Aug 2022 06:40:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8161F3858D28 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27C6DDbR035862; Fri, 12 Aug 2022 06:40:06 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hwhd90mdg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Aug 2022 06:40:06 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27C6JKaD019154; Fri, 12 Aug 2022 06:40:06 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hwhd90mce-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Aug 2022 06:40:05 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27C68MaJ009415; Fri, 12 Aug 2022 06:40:03 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma02fra.de.ibm.com with ESMTP id 3huww0tc44-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 12 Aug 2022 06:40:03 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27C6e1eo11141474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 12 Aug 2022 06:40:01 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 09C4CA4055; Fri, 12 Aug 2022 06:40:01 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 40A2FA4040; Fri, 12 Aug 2022 06:40:00 +0000 (GMT) Received: from pike.rch.stglabs.ibm.com (unknown [9.5.12.127]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 12 Aug 2022 06:40:00 +0000 (GMT) To: gcc-patches@gcc.gnu.org Subject: [PATCH] rs6000: avoid ineffective replacement of splitters Date: Fri, 12 Aug 2022 14:39:59 +0800 Message-Id: <20220812063959.151705-1-guojiufu@linux.ibm.com> X-Mailer: git-send-email 2.17.1 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Ab_RUd4ClQgAQtDov-_fm3-eLHU6s57w X-Proofpoint-ORIG-GUID: 7YzZbHuc3YZiJtSxVLX-GhFtFKyJlkKh X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-12_04,2022-08-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 adultscore=0 spamscore=0 mlxscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208120016 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Jiufu Guo via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Jiufu Guo <guojiufu@linux.ibm.com> Cc: dje.gcc@gmail.com, segher@kernel.crashing.org, linkw@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1740936531394504534?= X-GMAIL-MSGID: =?utf-8?q?1740936531394504534?= |
Series |
rs6000: avoid ineffective replacement of splitters
|
|
Commit Message
Jiufu Guo
Aug. 12, 2022, 6:39 a.m. UTC
Hi, As a comment in https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599556.html Those splitters call rs6000_emit_set_const directly, and the replacements are never used. Using (pc) would be less misleading. This patch pass bootstrap®test on ppc64 BE and LE. Is this ok for trunk. BR, Jeff(Jiufu) gcc/ChangeLog: * config/rs6000/rs6000.md: (constant splitters): Use "(pc)" as the replacements. --- gcc/config/rs6000/rs6000.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
Comments
Hi Jeff, on 2022/8/12 14:39, Jiufu Guo via Gcc-patches wrote: > Hi, > > As a comment in > https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599556.html > > Those splitters call rs6000_emit_set_const directly, and the replacements > are never used. Using (pc) would be less misleading. Since the replacements are never used, IMHO this subject doesn't quite meet the change. How about "fix misleading new patterns of splitters"? > > This patch pass bootstrap®test on ppc64 BE and LE. > Is this ok for trunk. This patch is OK w/ or w/o subject tweaked. Thanks! BR, Kewen > > BR, > Jeff(Jiufu) > > gcc/ChangeLog: > > * config/rs6000/rs6000.md: (constant splitters): Use "(pc)" as the > replacements. > > --- > gcc/config/rs6000/rs6000.md | 12 +++--------- > 1 file changed, 3 insertions(+), 9 deletions(-) > > diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md > index 1367a2cb779..7fadbeef1aa 100644 > --- a/gcc/config/rs6000/rs6000.md > +++ b/gcc/config/rs6000/rs6000.md > @@ -7727,11 +7727,7 @@ (define_split > [(set (match_operand:SI 0 "gpc_reg_operand") > (match_operand:SI 1 "const_int_operand"))] > "num_insns_constant (operands[1], SImode) > 1" > - [(set (match_dup 0) > - (match_dup 2)) > - (set (match_dup 0) > - (ior:SI (match_dup 0) > - (match_dup 3)))] > + [(pc)] > { > if (rs6000_emit_set_const (operands[0], operands[1])) > DONE; > @@ -9662,8 +9658,7 @@ (define_split > [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") > (match_operand:DI 1 "const_int_operand"))] > "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" > - [(set (match_dup 0) (match_dup 2)) > - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] > + [(pc)] > { > if (rs6000_emit_set_const (operands[0], operands[1])) > DONE; > @@ -9675,8 +9670,7 @@ (define_split > [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") > (match_operand:DI 1 "const_scalar_int_operand"))] > "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" > - [(set (match_dup 0) (match_dup 2)) > - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] > + [(pc)] > { > if (rs6000_emit_set_const (operands[0], operands[1])) > DONE;
Hi, "Kewen.Lin" <linkw@linux.ibm.com> writes: > Hi Jeff, > > on 2022/8/12 14:39, Jiufu Guo via Gcc-patches wrote: >> Hi, >> >> As a comment in >> https://gcc.gnu.org/pipermail/gcc-patches/2022-August/599556.html >> >> Those splitters call rs6000_emit_set_const directly, and the replacements >> are never used. Using (pc) would be less misleading. > > Since the replacements are never used, IMHO this subject doesn't > quite meet the change. How about "fix misleading new patterns > of splitters"? Thanks for your helpful sugguestion! BR, Jeff(Jiufu) > >> >> This patch pass bootstrap®test on ppc64 BE and LE. >> Is this ok for trunk. > > This patch is OK w/ or w/o subject tweaked. Thanks! > > BR, > Kewen > >> >> BR, >> Jeff(Jiufu) >> >> gcc/ChangeLog: >> >> * config/rs6000/rs6000.md: (constant splitters): Use "(pc)" as the >> replacements. >> >> --- >> gcc/config/rs6000/rs6000.md | 12 +++--------- >> 1 file changed, 3 insertions(+), 9 deletions(-) >> >> diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md >> index 1367a2cb779..7fadbeef1aa 100644 >> --- a/gcc/config/rs6000/rs6000.md >> +++ b/gcc/config/rs6000/rs6000.md >> @@ -7727,11 +7727,7 @@ (define_split >> [(set (match_operand:SI 0 "gpc_reg_operand") >> (match_operand:SI 1 "const_int_operand"))] >> "num_insns_constant (operands[1], SImode) > 1" >> - [(set (match_dup 0) >> - (match_dup 2)) >> - (set (match_dup 0) >> - (ior:SI (match_dup 0) >> - (match_dup 3)))] >> + [(pc)] >> { >> if (rs6000_emit_set_const (operands[0], operands[1])) >> DONE; >> @@ -9662,8 +9658,7 @@ (define_split >> [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") >> (match_operand:DI 1 "const_int_operand"))] >> "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" >> - [(set (match_dup 0) (match_dup 2)) >> - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] >> + [(pc)] >> { >> if (rs6000_emit_set_const (operands[0], operands[1])) >> DONE; >> @@ -9675,8 +9670,7 @@ (define_split >> [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") >> (match_operand:DI 1 "const_scalar_int_operand"))] >> "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" >> - [(set (match_dup 0) (match_dup 2)) >> - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] >> + [(pc)] >> { >> if (rs6000_emit_set_const (operands[0], operands[1])) >> DONE;
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 1367a2cb779..7fadbeef1aa 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -7727,11 +7727,7 @@ (define_split [(set (match_operand:SI 0 "gpc_reg_operand") (match_operand:SI 1 "const_int_operand"))] "num_insns_constant (operands[1], SImode) > 1" - [(set (match_dup 0) - (match_dup 2)) - (set (match_dup 0) - (ior:SI (match_dup 0) - (match_dup 3)))] + [(pc)] { if (rs6000_emit_set_const (operands[0], operands[1])) DONE; @@ -9662,8 +9658,7 @@ (define_split [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") (match_operand:DI 1 "const_int_operand"))] "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" - [(set (match_dup 0) (match_dup 2)) - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] + [(pc)] { if (rs6000_emit_set_const (operands[0], operands[1])) DONE; @@ -9675,8 +9670,7 @@ (define_split [(set (match_operand:DI 0 "int_reg_operand_not_pseudo") (match_operand:DI 1 "const_scalar_int_operand"))] "TARGET_POWERPC64 && num_insns_constant (operands[1], DImode) > 1" - [(set (match_dup 0) (match_dup 2)) - (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))] + [(pc)] { if (rs6000_emit_set_const (operands[0], operands[1])) DONE;