From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out203-205-221-240.mail.qq.com (out203-205-221-240.mail.qq.com [203.205.221.240]) by sourceware.org (Postfix) with UTF8SMTPS id 9BD2D3858D20 for ; Wed, 8 May 2024 03:01:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9BD2D3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=qq.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9BD2D3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=203.205.221.240 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715137298; cv=none; b=U10I1tS5vSTVcaRkR6Txee6A+XhkDBwO3AF2C72hYT9tsY6of6zE8LvrFr4V1ou9V4CpovQKFzaln/ivP/XaJFsJAswaE2t56MVmixJL871BdftqtsVm75bxtektqTmx/QByASPiQGo29/thn6EosPMqwX0sibLjNXFuP8VB56s= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715137298; c=relaxed/simple; bh=xZ6UU2C/Jft5ddfgtqGWATkZX1nMuQYEuRY+Yx78gHU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=s8oPZeo0UJK0/vwyMy40xGaAXXXOrlqm5JDZtlq2nc60+UwXuX8YCZwiIO+pAQECuonQ6af2JvKnT7WHtI8KHppXgZ6NAUnYYn3as7mlZ1F+g6nf1UNZykoGh8gFFzgsi/T9m/srt2nTqKe34UIIQzym5PaWqOHfsB/chO17c9o= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1715137293; bh=eMySlTL2KYW0okaz7IhkP5qIDaO92DM5PqfnEES50O8=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=E8xyBHenAhqDqm32tW5oI/KZaSHFtQEXmDBMnSJRFQF2gv2KrAtTVv4190hKR1aUW dLlWOcvpqQvKOXs2CNSl/vSS58GCt+nbqnp/j2XsDKcEdHdGPA95DC9Xt+AZH7l0i3 ShPr94eTB3CLuoukd2dGdFV3d/H2ELmmi3bC6t2E= Received: from [192.168.255.10] ([113.108.77.72]) by newxmesmtplogicsvrszc13-0.qq.com (NewEsmtp) with SMTP id 5A2F28B; Wed, 08 May 2024 11:01:26 +0800 X-QQ-mid: xmsmtpt1715137286tl6sszrs8 Message-ID: X-QQ-XMAILINFO: OVFdYp27KdlJobChbZ31ecMOBHkcR1J6Gw4UViFpwYQFezTLosGnY0m0QYtxwO Is7VccrMaeI7LKyR/OkgBvmRL7ki9LDLkeRwlmj1DSXSPJj/B8dzZKtk51tJbSEn5rWhPeDBWfK7 c4tlJBVcyyNo+Wh9RbiUAnFOcOZYVGtgQUFuAeyxnP4+LMNg2ZuCXtiVgEMga+G1MG2Hwq0dnfFE miLmC6/sayWSN1s0gg/PQL6JIfUN4U1sdPQQZQEWgpr5QNDuqIVAVIWh93eu2HYygK5QfO4NOzH1 FwOJleYmr3UlTU3+NLsjSxTCqt72A/b77SL+5sH+wqBEeHki3lugsgowJjiFRmwbiHoE35lrb4xX lAMx7RJt7hnds1jEVtk0Ey6tww17kztf07obsXduqpNyr068TBGy4xlTckUx/LT5qyokKwA9aGy9 CMpirgvuQ+2whCcOSfZovY6wYdNat7QSeYmqHMa6eO+2+bDkWnPH09x9te0f9eeESVnTP6im8EIV 8O6YCvQKoX8kq/2it5EeIba3VbTBg0PnW1v4HJ0qCyGEAaEEyBsC5ESVbnlqSy77rWlnQBNVlMut P0i5deMI7LvU1KklalYdw1WZQ6G+o+4Xhwg2TQGGt+a9JNjIEvkM86FCayKadCXxP7n6CG+gvrrW fXHO+1oyIGfT+6LJZf+v1LjNkfcIYS6d3Mt3pUgmVQq4yvWxqdRA6gT+JfoXHtpfLtqR5sKOm8y8 MMwZB1KICU0nYzMWRf+NDoPsNwZmSM4jH+Op+zCd2hfVKPtmPvasaKREZudSqq++hz5FJh+G2lJv GOuDsnVLm+gawffOICDvYygjYVmCcTcTDpTpPWzAhn8ytZIYA1kkImDo38nm3p2T+RbdUGN/iScE GQ5w54s0fgLoRgMhgMQkuh7emz6E/++9dDdEPFDIAq12xAxfCcaub70Z9Vyf2Cu3L+BadJJexhkk I6SIUTEOO02WlljvuTwTsToPTxMCfi3Jj/qgXGjLBWcNtAu5zjaGJDmTAsrVLx04ZucqsLoobjC/ GGjRGDvd7XSus73sr6wwZme2jNVkhf9S5XeT5ydY2dKV6Al6uKeih9KflfjhxpcVN9hclckw== X-QQ-XMRINFO: NyFYKkN4Ny6FSmKK/uo/jdU= X-OQ-MSGID: <817d2495-2da4-4c0b-b8f7-c9f48f92be7f@qq.com> Date: Wed, 8 May 2024 11:01:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/4] lra: Apply DF_LIVE_SUBREG data To: Vladimir Makarov Cc: richard.sandiford@arm.com, juzhe.zhong@rivai.ai, gcc-patches@gcc.gnu.org References: <20240203105012.208998-1-lehua.ding@rivai.ai> <20240203105012.208998-5-lehua.ding@rivai.ai> Content-Language: en-US From: Lehua Ding In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_MUA_MOZILLA,FREEMAIL_FROM,HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Vladimir, I'll send V3 patchs based on these comments. Note that these four patches only support subreg liveness tracking and apply to IRA and LRA pass. Therefore, no performance changes are expected before we support subreg coalesce. There will be new patches later to complete the subreg coalesce functionality. Support for subreg coalesce requires support for subreg copy i.e. modifying the logic for conflict detection. On 2024/5/2 00:24, Vladimir Makarov wrote: > > On 2/3/24 05:50, Lehua Ding wrote: >> This patch apply the DF_LIVE_SUBREG to LRA pass. More changes were made >> to the LRA than the IRA since the LRA will modify the DF data directly. >> The main big changes are centered on the lra-lives.cc file. >> >> gcc/ChangeLog: >> >> * lra-coalesce.cc (update_live_info): Extend to DF_LIVE_SUBREG. >> (lra_coalesce): Ditto. >> * lra-constraints.cc (update_ebb_live_info): Ditto. >> (get_live_on_other_edges): Ditto. >> (inherit_in_ebb): Ditto. >> (lra_inheritance): Ditto. >> (fix_bb_live_info): Ditto. >> (remove_inheritance_pseudos): Ditto. >> * lra-int.h (GCC_LRA_INT_H): include subreg-live-range.h >> (struct lra_insn_reg): Add op filed to record the corresponding rtx. >> * lra-lives.cc (class bb_data_pseudos): Extend the bb_data_pseudos to >> include new partial_def/use and range_def/use fileds for DF_LIVE_SUBREG >> problem. > Typo "fileds". >> (need_track_subreg_p): checking is the regno need to be tracked. >> (make_hard_regno_live): switch to live_subreg filed. > The same typo. >> (make_hard_regno_dead): Ditto. >> (mark_regno_live): Support record subreg liveness. >> (mark_regno_dead): Ditto. >> (live_trans_fun): Adjust transfer function to support subreg liveness. >> (live_con_fun_0): Adjust Confluence function to support subreg liveness. >> (live_con_fun_n): Ditto. >> (initiate_live_solver): Ditto. >> (finish_live_solver): Ditto. >> (process_bb_lives): Ditto. >> (lra_create_live_ranges_1): Dump subreg liveness. >> * lra-remat.cc (dump_candidates_and_remat_bb_data): Switch to >> DF_LIVE_SUBREG df data. >> (calculate_livein_cands): Ditto. >> (do_remat): Ditto. >> * lra-spills.cc (spill_pseudos): Ditto. >> * lra.cc (new_insn_reg): New argument op. >> (add_regs_to_insn_regno_info): Add new argument op. > > The patch is ok for me with some minor requests: > > You missed log entry for collect_non_operand_hard_regs.  Log entry for > lra_create_live_ranges_1 is not full (at least, it should be "Ditto. ..."). > > Also you changed signature for functions update_live_info, > fix_bb_live_info, mark_regno_live, mark_regno_dead, new_insn_reg but did > not updated the function comments.  Outdated comments are even worse > than the comment absence.  Please fix them. > > Also some variable naming could be improved but it is up to you. > > So now you need just an approval for the rest patches to commit your > work but they are not my area responsibility. > > It is difficult predict for patches of this size how they will work for > other targets.  I tested you patches on aarch64 and ppc64le. They seems > working right but please be prepare to switch them off (it is easy) if > the patches create some issues for other targets, of course until fixing > the issues. > > And thank you for your contribution.  Improving GCC performance these > days is a challenging task as so many people are working on GCC but you > found such opportunity and most importantly implement it. > > -- Best, Lehua