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 9330D385840D for ; Wed, 25 Oct 2023 11:13:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9330D385840D 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9330D385840D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698232422; cv=none; b=PciYaqOOi+bgOZAJ1SLDaVpGKNFcVK/PbNKT4fUHhdYW9PiUGkxwfBz49nDNS/BG7FmQucFNTKK0ROUjZKSPC6Eta7c4tQZwc3yr+g9VF+dgEgX1ek5UyH9CVosWzZFfiHOd9z7WY4kRtc+z01WdXoHNZbPGaHvB+ZcsYdpMtNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1698232422; c=relaxed/simple; bh=xzwrAORhGvbuBDccCj3QeqVqVlKC27dBQEclLQ0ELOY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=KFGu1cyGRLFxRjkYrRsbnWELQ2rE8V3ggkB7qRNv7zMRY+F5xC0MkF6WQZeMeQb3iuVwkpIWUREAfMV1EdMCAcG7g04Om6OtOodaHf1GS8h6BCyAmvzi48zzWGGNVHJdYjsSKKI18a+T06TGNb8gLA6Sj0dV8E78BGIMszr+PO4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39PBClko022151; Wed, 25 Oct 2023 11:13:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=wQIyBJQOBkRiiZ4jiRpjjX9kh+EUvYB4fEYePaZ+ONA=; b=Zu3yxgxBjpVR7Gc32OmlhT9LyeB4ugLBBJIzmnDC9eWFEd2CdoJNTopReTz3coZTkHnh PMY2n0uSzSeRW8r7PqrJpyxIECMIrMJ+4hKceKq9Pt3hp8NWv1/8Bjaj9Or+PWAbLgdp iiBCJOihiVrmjwmfbLT1uMsHkIQc0lgD4PhjgyXKCS/PIx9ENGvXpjVHk1MBifH/eClu jQz9D4QC8zJr3pEqijil6qOV/K2m0moX0tnFbhDiEuI6ochbnaf/DPuJdZG94DxomQil cLBVrsnWG8sF2ZWWdueaMld8gI1+AeG3k3SZhPmLFi4gcGgrW9PJZGJ8Aharc+ExEufR vg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ty1xng0vs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 11:13:39 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39PBDcI2024962; Wed, 25 Oct 2023 11:13:38 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ty1xng0u7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 11:13:38 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39PA2PN4010315; Wed, 25 Oct 2023 11:09:03 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([172.16.1.4]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tvsbyp9sd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 25 Oct 2023 11:09:03 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39PB92r131458008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 25 Oct 2023 11:09:03 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B4C4258083; Wed, 25 Oct 2023 11:09:02 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 79F3458081; Wed, 25 Oct 2023 11:08:57 +0000 (GMT) Received: from [9.43.20.19] (unknown [9.43.20.19]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Wed, 25 Oct 2023 11:08:57 +0000 (GMT) Message-ID: Date: Wed, 25 Oct 2023 16:38:53 +0530 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v9 4/4] ree: Improve ree pass for rs6000 target using defined ABI interfaces To: rep.dot.nop@gmail.com Cc: gcc-patches@gcc.gnu.org, Vineet Gupta , Jeff Law , Richard Biener , Segher Boessenkool , Peter Bergner , gnu-toolchain References: <32ca6e0e-ef68-4d4d-b864-c586a688b2c7@linux.ibm.com> <22541c92-a967-4e66-96b3-e4ad5011cd24@rivosinc.com> <20231023161027.362c626b@nbbrfq.loc> <8da41716-1111-4550-95dd-de41a402101e@linux.ibm.com> <4077DE16-87DA-4DDE-B119-6B516944B632@gmail.com> Content-Language: en-US From: Ajit Agarwal In-Reply-To: <4077DE16-87DA-4DDE-B119-6B516944B632@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: N8gc3uRgqjz8XUrf7CHW46ZUyapN1yp_ X-Proofpoint-ORIG-GUID: z9YLOQeCDmIolEOQ4EPyKPP6C3IXJcDk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-25_01,2023-10-25_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 suspectscore=0 mlxscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 priorityscore=1501 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310250096 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 25/10/23 2:06 am, rep.dot.nop@gmail.com wrote: > On 24 October 2023 09:36:22 CEST, Ajit Agarwal wrote: >> Hello Bernhard: >> >> On 23/10/23 7:40 pm, Bernhard Reutner-Fischer wrote: >>> On Mon, 23 Oct 2023 12:16:18 +0530 >>> Ajit Agarwal wrote: >>> >>>> Hello All: >>>> >>>> Addressed below review comments in the version 11 of the patch. >>>> Please review and please let me know if its ok for trunk. >>> >>> s/satisified/satisfied/ >>> >> >> I will fix this. > > thanks! > >> >>>>> As said, I don't see why the below was not cleaned up before the V1 submission. >>>>> Iff it breaks when manually CSEing, I'm curious why? >>> >>> The function below looks identical in v12 of the patch. >>> Why didn't you use common subexpressions? >>> ba >> >> Using CSE here breaks aarch64 regressions hence I have reverted it back >> not to use CSE, > > Just for my own education, can you please paste your patch perusing common subexpressions and an assembly diff of the failing versus working aarch64 testcase, along how you configured that failing (cross-?)compiler and the command-line of a typical testcase that broke when manually CSEing the function below? > > I might have not completely understood the subtile intricacies of RTL re-entrancy, it seems? > Here is the abi interface where I CSE'D and got a mail from automated regressions run that aarch64 test fails. static inline bool abi_extension_candidate_return_reg_p (int regno) { if (targetm.calls.function_value_regno_p (regno)) return true; return false; } +static inline bool +abi_extension_candidate_return_reg_p (int regno) +{ + return targetm.calls.function_value_regno_p (regno); +} I have not done any assembly diff as myself have not cross compiled with aarch64. Reverting above CSE the tests passes with automatically regression runs and build with linaro. Linaro runs the tests with every patch we submit in gcc-patches and if there is any fail they report error. Reverting CSE the Linaro tests passes. Thanks & Regards Ajit > thanks > >>>>> >>>>>>> +/* Return TRUE if reg source operand of zero_extend is argument registers >>>>>>> + and not return registers and source and destination operand are same >>>>>>> + and mode of source and destination operand are not same. */ >>>>>>> + >>>>>>> +static bool >>>>>>> +abi_extension_candidate_p (rtx_insn *insn) >>>>>>> +{ >>>>>>> + rtx set = single_set (insn); >>>>>>> + machine_mode dst_mode = GET_MODE (SET_DEST (set)); >>>>>>> + rtx orig_src = XEXP (SET_SRC (set), 0); >>>>>>> + >>>>>>> + if (!FUNCTION_ARG_REGNO_P (REGNO (orig_src)) >>>>>>> + || abi_extension_candidate_return_reg_p (/*insn,*/ REGNO (orig_src))) >>>>>>> + return false; >>>>>>> + >>>>>>> + /* Mode of destination and source should be different. */ >>>>>>> + if (dst_mode == GET_MODE (orig_src)) >>>>>>> + return false; >>>>>>> + >>>>>>> + machine_mode mode = GET_MODE (XEXP (SET_SRC (set), 0)); >>>>>>> + bool promote_p = abi_target_promote_function_mode (mode); >>>>>>> + >>>>>>> + /* REGNO of source and destination should be same if not >>>>>>> + promoted. */ >>>>>>> + if (!promote_p && REGNO (SET_DEST (set)) != REGNO (orig_src)) >>>>>>> + return false; >>>>>>> + >>>>>>> + return true; >>>>>>> +} >>>>>>> + >>> >>> >>>>> >>>>> As said, please also rephrase the above (and everything else if it obviously looks akin the above). >>> >>> thanks >