From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id AA29F382CE2C for ; Wed, 7 Dec 2022 03:06:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA29F382CE2C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B72S4J9028664; Wed, 7 Dec 2022 03:06:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=7i4MrQjBT0S1gxsVss+EeakjsScq68N/BizQdPS/n40=; b=Ghz/6Pv1Ln2bjNfTVWQ4wcHIBIS+rTy6sWL8MIigRoZoYM6ZrnzoXyzotc0Yzd1ppMQ7 nIvC4UF0tjWeLTsmvxFqGIj86pgdtr7wsACdZ0QLcne48sLe+0ZVe6uF0XmminYMjQaP 1VjlL00w24blAsDUsOFrnMNpwNH4gIG5xa/x+jiA6ed8aZwZ0bpXXw+iqSeZ/OU4lUVS gG3QnMfkqwzvH1JGG81kGYewcq9cu3PPj9XCtcnDdfvAXxj1zXX3/1wu1JCqAcECedV6 6TAl0EMidyWgtL+wmdrDxr00IB5cgqcvJzxHN2xT2wbT8RKBlZ3KK8Qx8bsLxO14ERyb kg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3maj2u0qd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Dec 2022 03:06:25 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2B72uRPI031890; Wed, 7 Dec 2022 03:06:24 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3maj2u0qc3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Dec 2022 03:06:24 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 2B6LRcIJ010322; Wed, 7 Dec 2022 03:06:22 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3m9ks429ur-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 07 Dec 2022 03:06:21 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2B736IK527591014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 7 Dec 2022 03:06:18 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3488D2004D; Wed, 7 Dec 2022 03:06:18 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0FB4320040; Wed, 7 Dec 2022 03:06:16 +0000 (GMT) Received: from [9.197.224.206] (unknown [9.197.224.206]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 7 Dec 2022 03:06:15 +0000 (GMT) Message-ID: Date: Wed, 7 Dec 2022 11:06:14 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v3, rs6000] Enable have_cbranchcc4 on rs6000 Content-Language: en-US To: HAO CHEN GUI Cc: Segher Boessenkool , David , Peter Bergner , gcc-patches References: From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: LHNomfnKHWGDGYem_h5-EvjY3U4kRgtY X-Proofpoint-ORIG-GUID: 4Vh9cwRPT6MuG-JFxvkvNGJt60_qGpig Content-Transfer-Encoding: 7bit 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.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-06_12,2022-12-06_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 phishscore=0 spamscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212070020 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,KAM_SHORT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Haochen, on 2022/12/6 13:44, HAO CHEN GUI wrote: > Hi, > This patch enables "have_cbranchcc4" on rs6000 by defining > a "cbranchcc4" expander. "have_cbrnachcc4" is a flag in ifcvt.cc > to indicate if branch by CC bits is invalid or not. With this > flag enabled, some branches can be optimized to conditional > moves. > > The patch relies on the former patch which is under review. > https://gcc.gnu.org/pipermail/gcc-patches/2022-December/607810.html > > Bootstrapped and tested on powerpc64-linux BE and LE with no > regressions. Is this okay for trunk? Any recommendations? Thanks > a lot. > > Thanks > Gui Haochen > > ChangeLog > 2022-12-06 Haochen Gui > > gcc/ > * config/rs6000/rs6000.md (cbranchcc4): New expander. > > gcc/testsuite > * gcc.target/powerpc/cbranchcc4.c: New. > * gcc.target/powerpc/cbranchcc4-1.c: New. Nit: "cbranchcc4.c" -> "cbranchcc4-2.c" since we already number the cases. > > > patch.diff > diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md > index e9e5cd1e54d..d7ddd96cc70 100644 > --- a/gcc/config/rs6000/rs6000.md > +++ b/gcc/config/rs6000/rs6000.md > @@ -11932,6 +11932,16 @@ (define_expand "cbranch4" > DONE; > }) > > +(define_expand "cbranchcc4" > + [(set (pc) > + (if_then_else (match_operator 0 "branch_comparison_operator" > + [(match_operand 1 "cc_reg_operand") > + (match_operand 2 "zero_constant")]) > + (label_ref (match_operand 3)) > + (pc)))] > + "" > + "") > + > (define_expand "cstore4_signed" > [(use (match_operator 1 "signed_comparison_operator" > [(match_operand:P 2 "gpc_reg_operand") > diff --git a/gcc/testsuite/gcc.target/powerpc/cbranchcc4-1.c b/gcc/testsuite/gcc.target/powerpc/cbranchcc4-1.c > new file mode 100644 > index 00000000000..3c8286bf091 > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/cbranchcc4-1.c > @@ -0,0 +1,17 @@ > +/* { dg-do compile } */ > +/* { dg-options "-O2" */ > + Missing one " }", typo from copy/paste? > +/* This case should be successfully compiled after cbranchcc4 is enabled. It > + generates a "*cbranch_2insn" insn which makes predicate check of cbranchcc4 > + failed and returns a NULL rtx from prepare_cmp_insn. */ Nit: May be shorter like "Verify there is no ICE with cbranchcc4 enabled." and put the details into commit logs. Does this issue which relies on the fix for generic part make bootstrapping fail? If no, how many failures it can cause? I'm thinking if we can commit this firstly, then in the commit log of the fix for generic part you can mention it can fix the ICE exposed by this test case. BR, Kewen