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 4110B3857412 for ; Wed, 23 Feb 2022 03:31:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4110B3857412 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21N0ibli018457; Wed, 23 Feb 2022 03:31:05 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3eda5sjknx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Feb 2022 03:31:04 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 21N3I985011705; Wed, 23 Feb 2022 03:31:04 GMT Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 3eda5sjknh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Feb 2022 03:31:04 +0000 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 21N3DO14014050; Wed, 23 Feb 2022 03:31:03 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma03dal.us.ibm.com with ESMTP id 3ear6bh29p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 23 Feb 2022 03:31:03 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 21N3V2Up33751350 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Feb 2022 03:31:02 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FC3AC6061; Wed, 23 Feb 2022 03:31:02 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA371C6066; Wed, 23 Feb 2022 03:31:01 +0000 (GMT) Received: from ltc.linux.ibm.com (unknown [9.10.229.42]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Wed, 23 Feb 2022 03:31:01 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 23 Feb 2022 11:31:01 +0800 From: guojiufu To: Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, rguenther@suse.de, dje.gcc@gmail.com, jlaw@tachyum.com, wschmidt@linux.ibm.com Subject: Re: [PATCH] Check if loading const from mem is faster In-Reply-To: <20220222173043.GX614@gate.crashing.org> References: <20220222065313.2040127-1-guojiufu@linux.ibm.com> <20220222173043.GX614@gate.crashing.org> Message-ID: X-Sender: guojiufu@linux.ibm.com User-Agent: Roundcube Webmail/1.1.12 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: KAYBA30MwVv1BKZHbjbQ7dpteKDU1rLl X-Proofpoint-ORIG-GUID: 5NdnP5R2f7uu19JaFHKXeY3BiTnWtQmB X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-23_01,2022-02-21_02,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 mlxlogscore=569 mlxscore=0 clxscore=1015 phishscore=0 impostorscore=0 priorityscore=1501 spamscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202230017 X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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-List-Received-Date: Wed, 23 Feb 2022 03:31:09 -0000 On 2022-02-23 01:30, Segher Boessenkool wrote: > Hi Jiu Fu, > > On Tue, Feb 22, 2022 at 02:53:13PM +0800, Jiufu Guo wrote: >> static bool >> rs6000_cannot_force_const_mem (machine_mode mode ATTRIBUTE_UNUSED, >> rtx x) >> { >> - if (GET_CODE (x) == HIGH >> - && GET_CODE (XEXP (x, 0)) == UNSPEC) >> + if (GET_CODE (x) == HIGH) >> return true; > Hi Segher, > This isn't explained anywhere. "Update" is not enough ;-) Thanks! I will add explanations for it. This excludes all 'HIGH' for 'x' code, like function "rs6000_emit_move" also check if the code is 'HIGH'. And on P10, I also encounter this kind of case like: (high:DI (symbol_ref:DI ("var_1") [flags 0xc0] )) Which fail to store into .rodata. > > > CSE is the pass that is most ancient and still causing problems left > and > right. It should be rewritten sooner rather than later. > > The problem with that is that the pass does so much more than just CSE, > and we don't want to lose all those other things. So it will be a slow > arduous affair of peeling off bits into separate passes, I think :-( Yes, it does a lot of work. One of the additional works is checking 'folding out constants and putting constant in memory'. BR, Jiufu > > Doing actual CSE without all the restrictive restrictions our pass has > historically had isn't the hard part! > > > Segher