public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate
@ 2014-10-21  3:21 Maxim Kuvyrkov
  2014-10-21 15:53 ` Vladimir Makarov
  0 siblings, 1 reply; 4+ messages in thread
From: Maxim Kuvyrkov @ 2014-10-21  3:21 UTC (permalink / raw)
  To: GCC Patches; +Cc: Vladimir Makarov, Jeff Law

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

Hi,

This patch cleans up (removes) cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate.

These seem to be an artifact from the scheduler refactoring 10+ years ago.  They assume that dfa_lookahead and issue_rate can change mid-way through scheduling, which is never the case.  All backends currently treat dfa_lookahead and issue_rate as constants for the duration of scheduling passes.

Bootstrapped on x86_64-linux-gnu.  Regression testing is in progress.  OK to commit if no regressions?

[ChangeLog is part of the git patch]

--
Maxim Kuvyrkov
www.linaro.org



[-- Attachment #2: 0003-Remove-cached_first_cycle_multipass_dfa_lookahead-an.patch --]
[-- Type: application/octet-stream, Size: 3280 bytes --]

From 3c26ff02a08d7b107a558b2033787f810ca900c9 Mon Sep 17 00:00:00 2001
From: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
Date: Mon, 20 Oct 2014 23:30:12 +0100
Subject: [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and
 cached_issue_rate

	* haifa-sched.c (cached_first_cycle_multipass_dfa_lookahead,)
	(cached_issue_rate): Remove.  Use dfa_lookahead and issue_rate instead.
	(max_issue, choose_ready, sched_init): Update.
---
 gcc/haifa-sched.c |   30 +++++-------------------------
 1 file changed, 5 insertions(+), 25 deletions(-)

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index f8549a0..4f9648c 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -5471,15 +5471,6 @@ int dfa_lookahead;
    could achieve DFA_LOOKAHEAD ** N , where N is the queue length.  */
 static int max_lookahead_tries;
 
-/* The following value is value of hook
-   `first_cycle_multipass_dfa_lookahead' at the last call of
-   `max_issue'.  */
-static int cached_first_cycle_multipass_dfa_lookahead = 0;
-
-/* The following value is value of `issue_rate' at the last call of
-   `sched_init'.  */
-static int cached_issue_rate = 0;
-
 /* The following function returns maximal (or close to maximal) number
    of insns which can be issued on the same cycle and one of which
    insns is insns with the best rank (the first insn in READY).  To
@@ -5508,9 +5499,8 @@ max_issue (struct ready_list *ready, int privileged_n, state_t state,
 	      && privileged_n <= n_ready);
 
   /* Init MAX_LOOKAHEAD_TRIES.  */
-  if (cached_first_cycle_multipass_dfa_lookahead != dfa_lookahead)
+  if (max_lookahead_tries == 0)
     {
-      cached_first_cycle_multipass_dfa_lookahead = dfa_lookahead;
       max_lookahead_tries = 100;
       for (i = 0; i < issue_rate; i++)
 	max_lookahead_tries *= dfa_lookahead;
@@ -5673,8 +5663,6 @@ static int
 choose_ready (struct ready_list *ready, bool first_cycle_insn_p,
 	      rtx_insn **insn_ptr)
 {
-  int lookahead;
-
   if (dbg_cnt (sched_insn) == false)
     {
       if (nonscheduled_insns_begin == NULL_RTX)
@@ -5695,11 +5683,7 @@ choose_ready (struct ready_list *ready, bool first_cycle_insn_p,
       return -1;
     }
 
-  lookahead = 0;
-
-  if (targetm.sched.first_cycle_multipass_dfa_lookahead)
-    lookahead = targetm.sched.first_cycle_multipass_dfa_lookahead ();
-  if (lookahead <= 0 || SCHED_GROUP_P (ready_element (ready, 0))
+  if (dfa_lookahead <= 0 || SCHED_GROUP_P (ready_element (ready, 0))
       || DEBUG_INSN_P (ready_element (ready, 0)))
     {
       if (targetm.sched.dispatch (NULL, IS_DISPATCH_ON))
@@ -6883,18 +6867,14 @@ sched_init (void)
   else
     issue_rate = 1;
 
-  if (cached_issue_rate != issue_rate)
-    {
-      cached_issue_rate = issue_rate;
-      /* To invalidate max_lookahead_tries:  */
-      cached_first_cycle_multipass_dfa_lookahead = 0;
-    }
-
   if (targetm.sched.first_cycle_multipass_dfa_lookahead)
     dfa_lookahead = targetm.sched.first_cycle_multipass_dfa_lookahead ();
   else
     dfa_lookahead = 0;
 
+  /* Set to "0" so that we recalculate.  */
+  max_lookahead_tries = 0;
+
   if (targetm.sched.init_dfa_pre_cycle_insn)
     targetm.sched.init_dfa_pre_cycle_insn ();
 
-- 
1.7.9.5


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

end of thread, other threads:[~2014-10-24  3:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-21  3:21 [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate Maxim Kuvyrkov
2014-10-21 15:53 ` Vladimir Makarov
2014-10-23  3:34   ` Maxim Kuvyrkov
2014-10-24  3:21     ` Vladimir Makarov

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