From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id E10A23858D39 for ; Wed, 22 Sep 2021 05:33:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E10A23858D39 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 18M5CDsq001187; Wed, 22 Sep 2021 01:33:15 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b7x4j8bbt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Sep 2021 01:33:15 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 18M5M4AH001981; Wed, 22 Sep 2021 01:33:14 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3b7x4j8bb9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Sep 2021 01:33:14 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 18M5Lv01025037; Wed, 22 Sep 2021 05:33:13 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma04ams.nl.ibm.com with ESMTP id 3b7q6qtc3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 22 Sep 2021 05:33:12 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 18M5SOun51773758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 22 Sep 2021 05:28:24 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 57A5411C050; Wed, 22 Sep 2021 05:33:10 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DE5A511C064; Wed, 22 Sep 2021 05:33:07 +0000 (GMT) Received: from kewenlins-mbp.cn.ibm.com (unknown [9.200.147.34]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 22 Sep 2021 05:33:07 +0000 (GMT) Subject: Re: [PATCH v2] ipa-inline: Add target info into fn summary [PR102059] To: Richard Biener , Martin Jambor Cc: Jan Hubicka , =?UTF-8?Q?Martin_Li=c5=a1ka?= , Segher Boessenkool , Bill Schmidt , Florian Weimer , GCC Patches References: <0d10e5a2-a966-3b26-2e59-b6fd98d703a2@linux.ibm.com> <8a4da9c1-b46e-5176-2cde-65ac4a59dd75@linux.ibm.com> <8d230b16-e507-583f-7d98-d2ff45c7e656@linux.ibm.com> From: "Kewen.Lin" Message-ID: Date: Wed, 22 Sep 2021 13:33:06 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: yZiT6E9DLCPGFdMHvLBZLxHSFZL9Gz6H X-Proofpoint-ORIG-GUID: uYNBTIeWQlksXWwaxizFr8HVJrq4PI38 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-09-22_01,2021-09-20_01,2020-04-07_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 spamscore=0 bulkscore=0 mlxscore=0 adultscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 impostorscore=0 phishscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2109200000 definitions=main-2109220037 X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP 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, 22 Sep 2021 05:33:17 -0000 on 2021/9/21 下午5:39, Richard Biener wrote: > On Tue, Sep 21, 2021 at 11:31 AM Martin Jambor wrote: >> >> Hi, >> >> On Tue, Sep 21 2021, Kewen.Lin wrote: >>> on 2021/9/17 下午7:26, Martin Jambor wrote: >>>> On Fri, Sep 17 2021, Kewen.Lin wrote: >> [...] >>>>> >>>>> Sorry that I failed to use 16 bit-fields for this, I figured out that >>>>> the bit-fields can not be address-taken or passed as non-const reference. >>>>> The gentype also failed to recognize uint16_t if I used uint16_t directly >>>>> in ipa-fnsummary.h. Finally I used unsigned int instead. >>>>> >>>> >>>> well, you could have used: >>>> >>>> unsigned int target_info : 16; >>>> >>>> for the field (and uint16_t when passed to hooks). >>>> >>>> But I am not sure if it is that crucial. >>>> >>> >>> I may miss something, specifically I tried with: >>> >>> 1) >>> >>> unsigned int target_info : 16; >>> unsigned inlinable : 1; >>> ... >>> >>> update_ipa_fn_target_info (uint16_t &, const gimple *) >> >> Yeah, you would have to copy the bit-field into a temporary, pass >> reference to that in the hook and then copy it back. At least that is >> what I meant but since we apparently want unsigned int everywhere, it >> does not matter. Ah, I misunderstood you didn't want this way since it seems inefficient. Will realize it next time since it looks like a tradeoff. :) > > Or use a by-value interface: > > uint16_t update_ipa_fn_target_info (uint16_t in, const gimple *stmt); > > with the function returning the (changed) set. Yeah, I considered this like: uint16_t update_ipa_fn_target_info (const uint16_t, const gimple*, bool&) but thought it might look weird to others at the first glances and gave up then. :( BR, Kewen