From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 60E35385AC1B for ; Thu, 11 Aug 2022 02:11:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 60E35385AC1B Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27B1naxK001175; Thu, 11 Aug 2022 02:11:54 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3hvresrhar-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 02:11:54 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27B2BsWk021663; Thu, 11 Aug 2022 02:11:54 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3hvresrha1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 02:11:53 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27B25C1B004627; Thu, 11 Aug 2022 02:11:52 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma03fra.de.ibm.com with ESMTP id 3huwvfs2jc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Aug 2022 02:11:52 +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 27B2BmmA36503828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Aug 2022 02:11:48 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8A5DA4040; Thu, 11 Aug 2022 02:11:48 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3C4DA4051; Thu, 11 Aug 2022 02:11:46 +0000 (GMT) Received: from [9.197.226.234] (unknown [9.197.226.234]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 11 Aug 2022 02:11:46 +0000 (GMT) Message-ID: Date: Thu, 11 Aug 2022 10:11:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v3] Modify combine pattern by a pseudo AND with its nonzero bits [PR93453] Content-Language: en-US To: Segher Boessenkool Cc: gcc-patches , David , "Kewen.Lin" , Peter Bergner References: <20220810173852.GC25951@gate.crashing.org> From: HAO CHEN GUI In-Reply-To: <20220810173852.GC25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: U5XgQDMDfDOkzFOQhEZzBvLR9w6sJ1G3 X-Proofpoint-GUID: K92gpgcBceVUtnHQ1IZTlfGAeuFMESXh 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-10_16,2022-08-10_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 phishscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208110004 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Aug 2022 02:11:56 -0000 Hi Segher, Really appreciate your review comments. On 11/8/2022 上午 1:38, Segher Boessenkool wrote: > Hi! > > Sorry for the tardiness. > > On Fri, Jul 22, 2022 at 03:07:55PM +0800, HAO CHEN GUI wrote: >> This patch creates a new function - change_pseudo_and_mask. If recog fails, >> the function converts a single pseudo to the pseudo AND with a mask if the >> outer operator is IOR/XOR/PLUS and inner operator is ASHIFT or AND. The >> conversion helps pattern to match rotate and mask insn on some targets. > > The name isn't so clear. It isn't changing a mask, to start with. How about setting function name to change_pseudo? It converts a pseudo to the pseudo AND with a mask in a particular situation. > >> +/* When the outer code of set_src is IOR/XOR/PLUS and the inner code is >> + ASHIFT/AND, > > "When the outercode of the SET_SRC of PAT is ..." Yeah, I will change it. > >> convert a pseudo to pseudo AND with a mask if its nonzero_bits >> + is less than its mode mask. The nonzero_bits in later passes is not a >> + superset of what is known in combine pass. So an insn with nonzero_bits >> + can't be recoged later. */ > > Can this not be done with a splitter in the machine description? > Sorry, I don't quite understand it. Do you mean if the conversion can be done in split pass? If a pseudo has DImode and stem from a char, we get nonzero_bits as 0xff in combine pass. But in split pass, it's nonzero_bits is 0xffffffffffffffff. So the conversion can only be done in combine pass. Thanks Gui Haochen