public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Jojo R <rjiejie@linux.alibaba.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Sandiford <richard.sandiford@arm.com>
Subject: Re: [PATCH] Adding target hook allows to reject initialization of register
Date: Wed, 18 Aug 2021 09:23:07 +0200	[thread overview]
Message-ID: <CAFiYyc3Bk0aAo6U8Be2B9SKgkDxvR5fo_jN-HB49JavTvAMAqQ@mail.gmail.com> (raw)
In-Reply-To: <80e3a7b4-ea9c-45cb-bf23-e8623c2b2a89@Spark>

On Wed, Aug 18, 2021 at 3:54 AM Jojo R <rjiejie@linux.alibaba.com> wrote:
>
>
> — Jojo
> 在 2021年8月16日 +0800 PM3:15,Richard Biener <richard.guenther@gmail.com>,写道:
>
> On Fri, Aug 13, 2021 at 3:59 AM Jojo R <rjiejie@linux.alibaba.com> wrote:
>
>
>
> — Jojo
> 在 2021年8月11日 +0800 PM6:44,Richard Biener <richard.guenther@gmail.com>,写道:
>
> On Wed, Aug 11, 2021 at 11:28 AM Richard Sandiford
> <richard.sandiford@arm.com> wrote:
>
>
> Richard Biener <richard.guenther@gmail.com> writes:
>
> On Tue, Aug 10, 2021 at 10:33 AM Jojo R via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
>
>
> Some target like RISC-V allow to group vector register as a whole,
> and only operate part of it in fact, but the 'init-regs' pass will add initialization
> for uninitialized registers. Add this hook to reject this action for reducing instruction.
>
>
> Are these groups "visible"? That is, are the pseudos multi-reg
> pseudos? I wonder
> if there's a more generic way to tame down initregs w/o introducing a new target
> hook.
>
> Btw, initregs is a red herring - it ideally should go away. See PR61810.
>
> So instead of adding to it can you see whether disabling the pass for RISC-V
> works w/o fallout (and add a comment to the PR)? Maybe some more RTL
> literate (in particular DF literate) can look at the remaining issue.
> Richard, did you
> ever have a look into the "issue" that initregs covers up (whatever
> that exactly is)?
>
>
> No, sorry. I don't really understand what it would be from the comment
> in the code:
>
> [...] papers over some problems on the arm and other
> processors where certain isa constraints cannot be handled by gcc.
> These are of the form where two operands to an insn my not be the
> same. The ra will only make them the same if they do not
> interfere, and this can only happen if one is not initialized.
>
> That would definitely be an RA bug if true, since the constraints need
> to be applied independently of dataflow information. But the comment
> and code predate LRA and maybe no-one fancied poking around in reload
> (hard to believe).
>
> I'd be very surprised if LRA gets this wrong.
>
>
> OK, we're wondering since quite some time - how about changing the
> gate of initregs to optimize > 0 && !targetm.lra_p ()? We'll hopefully
> figure out the "real" issue the pass is papering over. At the same time
> we're leaving old reload (and likely unmaintianed) targets unaffected.
>
> Richard,
>
> So this patch is not necessary ?
>
> I need to disable this pass in my situation only ?
> I am afraid some side effect in my projects without this init-regs pass … ...
>
>
> Can you try disabling the pass on RISC-V?
>
> Okay, I will do the test on GCC version 10.2, is it ok ?
> It will take a few days :)
>
> Or which version do you suggest to do this ?

Well, as recent as possible - I would at least suggest 11.2,
but trunk would be best of course.

Richard.

> Richard.
>
> Richard.
>
> Thanks,
> Richard

      reply	other threads:[~2021-08-18  7:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-10  8:32 Jojo R
2021-08-10 11:03 ` Richard Biener
2021-08-11  1:57   ` Jojo R
2021-08-11  5:53   ` Jojo R
2021-08-11  9:28   ` Richard Sandiford
2021-08-11 10:43     ` Richard Biener
2021-08-11 15:59       ` Richard Sandiford
2021-08-13  1:58       ` Jojo R
2021-08-16  7:15         ` Richard Biener
2021-08-18  1:54           ` Jojo R
2021-08-18  7:23             ` Richard Biener [this message]

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=CAFiYyc3Bk0aAo6U8Be2B9SKgkDxvR5fo_jN-HB49JavTvAMAqQ@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    --cc=rjiejie@linux.alibaba.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).