public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Alex Coplan <alex.coplan@arm.com>
To: gcc-patches@gcc.gnu.org
Cc: Richard Sandiford <richard.sandiford@arm.com>,
	Jim Wilson <wilson@tuliptree.org>,
	Michael Meissner <gnu@the-meissners.org>,
	Jeff Law <jeffreyalaw@gmail.com>,
	Vladimir Makarov <vmakarov@redhat.com>
Subject: [PATCH 06/11] haifa-sched: Allow for NOTE_INSN_DELETED at start of epilogue
Date: Tue, 17 Oct 2023 21:48:19 +0100	[thread overview]
Message-ID: <ZS7zE+uo4mdL6dr4@arm.com> (raw)

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

haifa-sched.cc:remove_notes asserts that it lands on a real (non-note)
insn after advancing past NOTE_INSN_EPILOGUE_BEG, but with the upcoming
post-RA aarch64 load pair pass enabled, we can land on
NOTE_INSN_DELETED.

This patch adjusts remove_notes to remove these if they occur at the
start of the epilogue instead of asserting.

Bootstrapped/regtested as a series on aarch64-linux-gnu, OK for trunk?

gcc/ChangeLog:

	* haifa-sched.cc (remove_notes): Allow for NOTE_INSN_DELETED at
	the start of the epilgoue, remove these.
---
 gcc/haifa-sched.cc | 11 +++++++++++
 1 file changed, 11 insertions(+)


[-- Attachment #2: 0006-haifa-sched-Allow-for-NOTE_INSN_DELETED-at-start-of-.patch --]
[-- Type: text/x-patch, Size: 691 bytes --]

diff --git a/gcc/haifa-sched.cc b/gcc/haifa-sched.cc
index 8e8add709b3..9f45528fbe9 100644
--- a/gcc/haifa-sched.cc
+++ b/gcc/haifa-sched.cc
@@ -4249,6 +4249,17 @@ remove_notes (rtx_insn *head, rtx_insn *tail)
 		  && NOTE_KIND (next) == NOTE_INSN_BASIC_BLOCK
 		  && next != next_tail)
 		next = NEXT_INSN (next);
+
+	      /* Skip over any NOTE_INSN_DELETED at the start of the epilogue.
+	       */
+	      while (NOTE_P (next)
+		     && NOTE_KIND (next) == NOTE_INSN_DELETED)
+		{
+		  auto tmp = NEXT_INSN (next);
+		  delete_insn (next);
+		  next = tmp;
+		}
+
 	      gcc_assert (INSN_P (next));
 	      add_reg_note (next, REG_SAVE_NOTE,
 			    GEN_INT (NOTE_INSN_EPILOGUE_BEG));

             reply	other threads:[~2023-10-17 20:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 20:48 Alex Coplan [this message]
2023-10-19 14:54 ` Jeff Law
2023-10-19 17:52   ` Alex Coplan

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=ZS7zE+uo4mdL6dr4@arm.com \
    --to=alex.coplan@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gnu@the-meissners.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=richard.sandiford@arm.com \
    --cc=vmakarov@redhat.com \
    --cc=wilson@tuliptree.org \
    /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).