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 027AC3858D28 for ; Tue, 17 Jan 2023 20:57:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 027AC3858D28 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 (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 30HKS1oQ010379; Tue, 17 Jan 2023 20:57:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=pp1; bh=ctV/UtFP/g4nnu4FoIKz2C8YmbxL9kMb/FfPPJwvxJc=; b=mFxs+oUcqx35XWSsXwP0MjgYUARIAQC0Vd69P3oeEyRD+X0T0JdMCvDAK7jGHDaAepUW 2MPX+AOH2AJ+4M1YBy8fY43PjpN74HkunkpzLYjkJW5REt4fdkOAQrSdPyQAja3rkXAb G8Oa0Dk+mIvg/6Ivgq1pGvu7r/05/9ovr44zkPNtgdiMLvb8ZzancLM8nf6kmj3qsg1L 1QIf6B2kYVtBVUzBen5CWDhhX4mvdPNW5/4pvp0SmRy37ihT5qWUeJpw5mBcP+NS5346 TWwN3FuarQufwDiy4HnKFDNYQKGuNvP1driO4N8eX2j9vsvYfiG5jYMNwEePf26UB3hV qw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3n62qwrj4v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Jan 2023 20:57:29 +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 30HKakGZ009157; Tue, 17 Jan 2023 20:57:28 GMT Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3n62qwrj4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Jan 2023 20:57:28 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30HJb4OU005665; Tue, 17 Jan 2023 20:57:28 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3n3m17fyw3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 17 Jan 2023 20:57:28 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30HKvQLZ36766004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jan 2023 20:57:26 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB75558059; Tue, 17 Jan 2023 20:57:26 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 49BFC58055; Tue, 17 Jan 2023 20:57:26 +0000 (GMT) Received: from toto.the-meissners.org (unknown [9.160.42.232]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTPS; Tue, 17 Jan 2023 20:57:26 +0000 (GMT) Date: Tue, 17 Jan 2023 15:57:24 -0500 From: Michael Meissner To: "Kewen.Lin" Cc: GCC Patches , Segher Boessenkool , David Edelsohn , Peter Bergner , Michael Meissner Subject: Re: [PATCH/RFC] rs6000: Remove optimize_for_speed check for implicit TARGET_SAVE_TOC_INDIRECT [PR108184] Message-ID: Mail-Followup-To: Michael Meissner , "Kewen.Lin" , GCC Patches , Segher Boessenkool , David Edelsohn , Peter Bergner References: <6305f0e5-d235-8916-6d42-7110cfede236@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6305f0e5-d235-8916-6d42-7110cfede236@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Hm_E6RxeInR-qiAGJiQKImbqWgC-uHIY X-Proofpoint-ORIG-GUID: zvIlsz48o5mT-LqcYNKZCiCA11u27aFe X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.923,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-01-17_10,2023-01-17_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 priorityscore=1501 mlxlogscore=309 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301170164 X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,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: On Mon, Jan 16, 2023 at 05:39:04PM +0800, Kewen.Lin wrote: > Hi, > > Now we will check optimize_function_for_speed_p (cfun) for > TARGET_SAVE_TOC_INDIRECT if it's implicitly enabled. But > the effect of -msave-toc-indirect is actually to save the > TOC in the prologue for indirect calls rather than inline, > it's also good for optimize_function_for_size? So this > patch is to remove the check of optimize_function_for_speed > and make it work for both optimizing for size and speed. > > Bootstrapped and regtested on powerpc64-linux-gnu P8, > powerpc64le-linux-gnu P{9,10} and powerpc-ibm-aix. > > Any thoughts? > > Thanks in advance! Well in terms of size, it is only a savings if we have 2 or more indirect calls within a module, and we are not compiling for power10. On power9, if we have just one indirect call, then it is the same size. On power10, the -msave-toc-indirect switch does nothing, because we don't need TOCs when we have prefixed addressing. So I have objection to the change. I suspect it may be better with a check for just optimize either for speed or size, and not for speed. The option however, can slow things down if there is an early exit to the function since the store would always be done, even if the function exits early. -- Michael Meissner, IBM PO Box 98, Ayer, Massachusetts, USA, 01432 email: meissner@linux.ibm.com