From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 7DC6F385841A for ; Tue, 22 Nov 2022 05:12:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7DC6F385841A 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 (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2AM4xIgI023880; Tue, 22 Nov 2022 05:12:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=W4c529D+c8ZYm7HPblNJdiNm0z8SkYprVYXKOQL2bB8=; b=l+buqPUMkkNq9hxyRhUSRNq6/3yzeao0+ZLHtROo95z/oftNK+siMzTRo55wYcUud3vs e8V/WW+F5LfM4tC6N2fuyAmjSie4hMqorTBgHlnqeVW3kmHDrKU07aeoyDw1DAxiDuJ/ a9iC1RX2QhMHBz205/D1UXkCbVMvOlKLNmITcUB48LUKCi9hHAZ+c5tdxzy41TVlbvMy 3OPFHh8SRdL2fnv+kIoxFMXzONbpo5flJSgV309e4rMsjprNcf8U5n0q/42cJijIZIfn Jn99bmV1s4sPiqizi6NMMUag+qxuA1N3Qu+w8kpUwQfeTne4QqOQNQgJAzB8xuwKUq1M vw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m0qvfg9t8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Nov 2022 05:12:53 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2AM4xUZh024817; Tue, 22 Nov 2022 05:12:52 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m0qvfg9sw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Nov 2022 05:12:52 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2AM56jcZ024387; Tue, 22 Nov 2022 05:12:50 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma01fra.de.ibm.com with ESMTP id 3kxps92njh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Nov 2022 05:12:49 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2AM5Ckjt53871042 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 22 Nov 2022 05:12:46 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60BD7AE055; Tue, 22 Nov 2022 05:12:46 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4CF2AAE045; Tue, 22 Nov 2022 05:12:44 +0000 (GMT) Received: from [9.197.246.117] (unknown [9.197.246.117]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 22 Nov 2022 05:12:43 +0000 (GMT) Message-ID: Date: Tue, 22 Nov 2022 13:12:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCHv2, rs6000] Enable have_cbranchcc4 on rs6000 To: "Kewen.Lin" Cc: David Edelsohn , gcc-patches , Peter Bergner , Segher Boessenkool References: <438c6628-0b9c-e5d0-e198-2fd6edd16a93@linux.ibm.com> <20221118121822.GY25951@gate.crashing.org> <4056dfc0-57e3-0d13-633c-297572c5c647@linux.ibm.com> <172f8c34-fc63-8434-0528-4261b5c6a8ba@linux.ibm.com> From: HAO CHEN GUI In-Reply-To: <172f8c34-fc63-8434-0528-4261b5c6a8ba@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 75i-XpRhrpaFwe-QtTKk4sd9KMlXIxIc X-Proofpoint-GUID: yn2NeWMOkVLSIwSlaIYzHRjC400fdeQ- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-22_02,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 bulkscore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 suspectscore=0 mlxlogscore=978 priorityscore=1501 mlxscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211220036 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 Kewen, 在 2022/11/22 11:11, Kewen.Lin 写道: > Maybe we can adjust prepare_cmp_insn to fail if the constructed cbranchcc4 > pattern doesn't satisfy the predicate of operand 0 rather than to assert. > It's something like: > > if (!insn_operand_matches (icode, 0, test)) > goto fail; > > or only assign and return if insn_operand_matches (icode, 0, test). > > The code makes the assumption that all this kind of cbranchcc4 patterns > should match what target defines for cbranchcc4 optab, but unfortunately > it's not sure for our port and I don't see how it should be. Thanks for your comments. I just drafted a patch to let it go to "fail" when predicate of operand 0 is not satisfied. It works and passed bootstrap on ppc64le. But my concern is prepare_cmp_insn is a generic function and is used to create a cmp rtx. It is not only called by emit_conditional* (finally called by ifcvt) but other functions (even new functions). If we change the logical in prepare_cmp_insn, we may lost some potential optimization. After all, the branch_2insn is a valid insn. I think the essential of the problem is we want to exclude those comparisons (from cbranchcc4 used in ifcvt) which need two CC bits. So, we can change the logical of ifcvt - add an additional check with predicate of operand 0 when checking the have_cbranchcc4 flag in ifcvt. What's your opinion? Thanks Gui Haochen