public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] In the ready lists of pipeline, put unrecog insns (such as CLOBBER,USE) at the latest to issue.
@ 2023-03-23  8:07 Jin Ma
  2023-03-27 17:01 ` [PATCH] In the ready lists of pipeline, put unrecog insns (such as CLOBBER, USE) " Richard Sandiford
  0 siblings, 1 reply; 16+ messages in thread
From: Jin Ma @ 2023-03-23  8:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: kito.cheng, kito.cheng, palmer, jeffreyalaw, ijinma, Jin Ma

  Unrecog insns (such as CLOBBER, USE) does not represent real instructions, but in the
process of pipeline optimization, they will wait for transmission in ready list like
other insns, without considering resource conflicts and cycles. This results in a
multi-issue CPU architecture that can be issued at any time if other regular insns
have resource conflicts or cannot be launched for other reasons. As a result, its
position is advanced in the generated insns sequence, which will affect register
allocation and often lead to more redundant mov instructions.

gcc/ChangeLog:

	* haifa-sched.cc (prune_ready_list): Consider unrecog insns(CLOBBER and USE)
	in pruning ready lists.
---
 gcc/haifa-sched.cc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/gcc/haifa-sched.cc b/gcc/haifa-sched.cc
index 48b53776fa9..72c4c44da76 100644
--- a/gcc/haifa-sched.cc
+++ b/gcc/haifa-sched.cc
@@ -6318,6 +6318,14 @@ prune_ready_list (state_t temp_state, bool first_cycle_insn_p,
 	      cost = 1;
 	      reason = "not a shadow";
 	    }
+	  else if (recog_memoized (insn) < 0
+		  && (GET_CODE (PATTERN (insn)) == CLOBBER
+		  || GET_CODE (PATTERN (insn)) == USE))
+	    {
+	      if (!first_cycle_insn_p)
+		cost = 1;
+	      reason = "unrecog insn";
+	    }
 	  else if (recog_memoized (insn) < 0)
 	    {
 	      if (!first_cycle_insn_p
-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2023-11-13  2:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23  8:07 [PATCH] In the ready lists of pipeline, put unrecog insns (such as CLOBBER,USE) at the latest to issue Jin Ma
2023-03-27 17:01 ` [PATCH] In the ready lists of pipeline, put unrecog insns (such as CLOBBER, USE) " Richard Sandiford
2023-04-14 21:38   ` Jeff Law
2023-05-29 10:51     ` [PATCH] In the pipeline, UNRECOG INSN is not executed in advance if it starts a live range Jin Ma
2023-06-08  1:50       ` Jin Ma
2023-06-09 23:40       ` Jeff Law
2023-06-12  3:38         ` Jin Ma
2023-11-11 18:51           ` Jeff Law
2023-08-14 11:22         ` [PATCH v2] In the pipeline, USE or CLOBBER should delay execution if it starts a new " Jin Ma
2023-08-29  8:00           ` Jin Ma
2023-11-11 20:12           ` Jeff Law
2023-11-12 17:41             ` Xi Ruoyao
2023-11-12 18:02               ` Jeff Law
2023-11-12 18:11                 ` Xi Ruoyao
2023-11-13  2:16                 ` Jin Ma
2023-11-13  2:28                   ` Jeff Law

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).