public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Vladimir Makarov <vmakarov@redhat.com>
To: Lehua Ding <lehua.ding@rivai.ai>, gcc-patches@gcc.gnu.org
Cc: richard.sandiford@arm.com, juzhe.zhong@rivai.ai
Subject: Re: [PATCH 4/4] lra: Apply DF_LIVE_SUBREG data
Date: Wed, 1 May 2024 12:24:30 -0400	[thread overview]
Message-ID: <c4acb89c-35fd-450c-9040-2faefa867493@redhat.com> (raw)
In-Reply-To: <20240203105012.208998-5-lehua.ding@rivai.ai>

[-- Attachment #1: Type: text/plain, Size: 2907 bytes --]


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.


  reply	other threads:[~2024-05-01 16:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-03 10:50 [PATCH 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Lehua Ding
2024-02-03 10:50 ` [PATCH 1/4] df: Add -ftrack-subreg-liveness option Lehua Ding
2024-02-03 10:50 ` [PATCH 2/4] df: Add DF_LIVE_SUBREG problem Lehua Ding
2024-02-03 10:50 ` [PATCH 3/4] ira: Apply DF_LIVE_SUBREG data Lehua Ding
2024-05-01 16:21   ` Vladimir Makarov
2024-02-03 10:50 ` [PATCH 4/4] lra: " Lehua Ding
2024-05-01 16:24   ` Vladimir Makarov [this message]
2024-05-08  3:01     ` Lehua Ding
2024-05-08 16:29       ` Vladimir Makarov
2024-05-08 22:16         ` 钟居哲
2024-02-05  7:01 ` [PATCH 0/4] Add DF_LIVE_SUBREG data and apply to IRA and LRA Lehua Ding
2024-02-05 16:10   ` Jeff Law
2024-02-06  1:44     ` Lehua Ding
2024-02-06 13:43     ` Vladimir Makarov
2024-02-05 18:17 ` Joseph Myers
2024-02-06  1:44   ` Lehua Ding
2024-04-24 10:05 [PATCH V2 " Lehua Ding
2024-04-24 10:05 ` [PATCH 4/4] lra: Apply DF_LIVE_SUBREG data Lehua Ding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c4acb89c-35fd-450c-9040-2faefa867493@redhat.com \
    --to=vmakarov@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=juzhe.zhong@rivai.ai \
    --cc=lehua.ding@rivai.ai \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).