public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Senthil Kumar via Gcc-patches <gcc-patches@gcc.gnu.org>,
	Senthil Kumar <senthil.thecoder@gmail.com>,
	ebotcazou@adacore.com, richard.sandiford@arm.com
Subject: Re: [PATCH] emit-rtl.c: Allow splitting of RTX_FRAME_RELATED_P insns?
Date: Mon, 10 Aug 2020 17:53:27 -0500	[thread overview]
Message-ID: <20200810225327.GG6753@gate.crashing.org> (raw)
In-Reply-To: <mptmu32wk6o.fsf@arm.com>

On Mon, Aug 10, 2020 at 05:16:15PM +0100, Richard Sandiford wrote:
> Senthil Kumar via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
> >   The wiki suggests using post-reload splitters, so that's the
> >   direction I took, but I ran into an issue where split_insn
> >   bails out early if RTX_FRAME_RELATED_P is true - this means
> >   that splits for REG_CC clobbering insns with
> >   RTX_FRAME_RELATED_P will never execute, resulting in a
> >   could-not-split insn ICE in the final stage.
> >
> >   I see that the recog.c:peep2_attempt allows splitting of a
> >   RTX_FRAME_RELATED_P insn, provided the result of the split is a
> >   single insn. Would it be ok to modify try_split also to
> >   allow those kinds of insns (tentative patch attached, code
> >   copied over from peep2_attempt, only setting old and new_insn)? Or is there
> >   a different approach to fix this?
> 
> I agree there's no obvious reason why splitting to a single insn
> should be rejected but a peephole2 to a single instruction should be OK.
> And reusing the existing, tried-and-tested code is the way to go.

The only obvious difference is that the splitters run many times, while
peep2 runs only once, very late.  If you make this only do stuff for
reload_completed splitters, that difference is gone as well.

> But could you split the code out of peep2_attempt into a subroutine
> (probably still in recog.c) and reuse it in try_split?

Yes please :-)


Segher

  reply	other threads:[~2020-08-10 22:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-07  9:00 Senthil Kumar
2020-08-10 16:16 ` Richard Sandiford
2020-08-10 22:53   ` Segher Boessenkool [this message]
2020-08-11  6:59     ` Richard Sandiford
2020-08-11 21:40       ` Segher Boessenkool
2020-08-13 13:15   ` Senthil Kumar Selvaraj
2020-08-20 12:10     ` Richard Sandiford

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=20200810225327.GG6753@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    --cc=senthil.thecoder@gmail.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).