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 6AA083858D28 for ; Wed, 18 Jan 2023 09:04:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6AA083858D28 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 30I8pJlr013336; Wed, 18 Jan 2023 09:04:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : references : cc : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=3qYJmixG3MvAFW0ZJIHGx9VlMfz47+FlY7ATcsKQ8x8=; b=Oii/JqWy1K1ydzk3T+/ImPr2c/+RpcKyh1bcvRB3QZxe296v/FmOh8HyJlR01jQMuewo naNZv1jkqNfqO9/m8126fh9AZUNEUnGWpEW8IUY3gZekB1c0a2cHafr9J94Ybtv5ofut M6vHVCQd9bRar57Lb5UoPcFE5crtpt+JbPFA4wzjUolK8mw61JtinZlcnhd8kZ9SmJVg E+nufCgbsCsDLJkJHopnLFiCm4Kl8LyVm9hxoyF4/EZ2LbjPQ23YU7G1gWfiWnwlmxdy WdG+Xh3R4tWef7wR45kidCiK5+RetEO77DtUwhM/Ivz0x8Ne7Z/6tnXsH8oTrxRJn4zm 3Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3n6dmg88hf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Jan 2023 09:04:35 +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 30I8tNKh027143; Wed, 18 Jan 2023 09:04:35 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3n6dmg88gs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Jan 2023 09:04:35 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 30I66iRa028851; Wed, 18 Jan 2023 09:04:33 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3n3m16bnjc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Jan 2023 09:04:33 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 30I94TIG47317376 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 18 Jan 2023 09:04:29 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94DF220043; Wed, 18 Jan 2023 09:04:29 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E44F20040; Wed, 18 Jan 2023 09:04:27 +0000 (GMT) Received: from [9.197.238.43] (unknown [9.197.238.43]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 18 Jan 2023 09:04:27 +0000 (GMT) Message-ID: <5d9a586c-8649-16c0-9af6-7b5c28314a42@linux.ibm.com> Date: Wed, 18 Jan 2023 17:04:25 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH/RFC] rs6000: Remove optimize_for_speed check for implicit TARGET_SAVE_TOC_INDIRECT [PR108184] Content-Language: en-US To: Michael Meissner References: <6305f0e5-d235-8916-6d42-7110cfede236@linux.ibm.com> Cc: GCC Patches , Segher Boessenkool , David Edelsohn , Peter Bergner From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: VCiLTjtzHs1lb80y4_RrQ90T6ytYTwOU X-Proofpoint-GUID: it7XYKsU3N14ke7c4KC9Jb5l7wizPlah 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-18_03,2023-01-17_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=335 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2301180078 X-Spam-Status: No, score=-5.3 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 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 Mike, Thanks for the comments! on 2023/1/18 04:57, Michael Meissner wrote: > 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. Yes, exactly, so the test cases have the explicit option -mno-pcrel. > > 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. > Good point, I guessed that's why we only try to turn it on under the guard flag_shrink_wrap_separate when there is no explicit -m{no-,}save-toc-indirect. BR, Kewen