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 V3 5/7] ira: Add all nregs >= 2 pseudos to tracke subreg list
Date: Thu, 16 Nov 2023 16:14:47 -0500	[thread overview]
Message-ID: <3c9d365d-1990-3832-86b1-8b0804d9d5a0@redhat.com> (raw)
In-Reply-To: <20231112120817.2635864-6-lehua.ding@rivai.ai>


On 11/12/23 07:08, Lehua Ding wrote:
> This patch relax the subreg track capability to all subreg registers.
The patch is ok for me when general issues I mentioned in my first email 
and the issue given below are fixed.
> gcc/ChangeLog:
>
> 	* ira-build.cc (get_reg_unit_size): New.
> 	(has_same_nregs): New.
> 	(ira_set_allocno_class): Adjust.
>
...
> +
> +/* Return true if TARGET_CLASS_MAX_NREGS and TARGET_HARD_REGNO_NREGS results is
> +   same. It should be noted that some targets may not implement these two very
> +   uniformly, and need to be debugged step by step. For example, in V3x1DI mode
> +   in AArch64, TARGET_CLASS_MAX_NREGS returns 2 but TARGET_HARD_REGNO_NREGS
> +   returns 3. They are in conflict and need to be repaired in the Hook of
> +   AArch64.  */
> +static bool
> +has_same_nregs (ira_allocno_t a)
> +{
> +  for (int i = 0; i < FIRST_PSEUDO_REGISTER; i++)
> +    if (REGNO_REG_CLASS (i) != NO_REGS
> +	&& reg_class_subset_p (REGNO_REG_CLASS (i), ALLOCNO_CLASS (a))
> +	&& ALLOCNO_NREGS (a) != hard_regno_nregs (i, ALLOCNO_MODE (a)))
> +      return false;
> +  return true;
> +}
> +

It is better to fix the problem source.  But sometimes it is hard to do 
this for all targets.  RA already has analogous code.  So it is ok for 
me.  The only thing is that it is too expensive to do this for each 
allocno.  You should implement some cache (class, mode)->result.



  reply	other threads:[~2023-11-16 21:14 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-12 12:08 [PATCH V3 0/7] ira/lra: Support subreg coalesce Lehua Ding
2023-11-12 12:08 ` [PATCH V3 1/7] df: Add DF_LIVE_SUBREG problem Lehua Ding
2023-11-13 22:38   ` Vladimir Makarov
2023-11-14  8:14     ` Richard Biener
2023-11-14  8:38       ` Lehua Ding
2023-11-14  9:03         ` Richard Biener
2023-11-14 14:52           ` Vladimir Makarov
2023-11-14 17:18         ` Vladimir Makarov
2023-11-14 18:29           ` Vladimir Makarov
2023-11-20 20:11   ` Richard Sandiford
2023-11-21  6:35     ` Lehua Ding
2023-11-12 12:08 ` [PATCH V3 2/7] ira: Switch to live_subreg data Lehua Ding
2023-11-14 20:26   ` Vladimir Makarov
2023-11-12 12:08 ` [PATCH V3 3/7] ira: Support subreg live range track Lehua Ding
2023-11-14 20:37   ` Vladimir Makarov
2023-11-12 12:08 ` [PATCH V3 4/7] ira: Support subreg copy Lehua Ding
2023-11-16 21:13   ` Vladimir Makarov
2023-11-17  2:06     ` Lehua Ding
2023-11-17 14:05       ` Vladimir Makarov
2023-11-18  8:00         ` Lehua Ding
2023-11-18  8:06           ` Sam James
2023-11-18  8:16             ` Lehua Ding
2023-11-18  8:24               ` Sam James
2023-11-18  8:27                 ` Lehua Ding
2023-11-12 12:08 ` [PATCH V3 5/7] ira: Add all nregs >= 2 pseudos to tracke subreg list Lehua Ding
2023-11-16 21:14   ` Vladimir Makarov [this message]
2023-11-12 12:08 ` [PATCH V3 6/7] lra: Switch to live_subreg data flow Lehua Ding
2023-11-12 12:08 ` [PATCH V3 7/7] lra: Support subreg live range track and conflict detect Lehua Ding
2023-11-13 16:43 ` [PATCH V3 0/7] ira/lra: Support subreg coalesce Dimitar Dimitrov
2023-11-15  2:10   ` Lehua Ding
2023-11-13 19:37 ` Vladimir Makarov
2023-11-14  5:37   ` Lehua Ding
2023-11-14 23:33     ` Peter Bergner
2023-11-14 23:22 ` Peter Bergner
2023-11-15  3:12   ` Lehua Ding
2023-11-15  3:33     ` Peter Bergner

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=3c9d365d-1990-3832-86b1-8b0804d9d5a0@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).