This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Zen tuning part 3: Simplify ia32_multipass_dfa_lookahead


Hi,
ia32_multipass_dfa_lookahead currently defaults to issue rate for all modern
CPUs.  It return 1 for pentiumpro and k6 but I believe it is only because no
one was interested to benchmark it and enable it.

I do not think these two exceptions are worth of the maintenance burden
especially because both of these was quite decoder bound and decoders was
not always symmetric, so DFA is most likely helping there as well.

This also fixes problem that function should return 4 for znver1.

Bootstrapped/regtested x86_64-linux, will commit it shortly.

	* i386.c (ia32_multipass_dfa_lookahead): Default to issue rate
	for post-reload scheduling.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 253449)
+++ config/i386/i386.c	(working copy)
@@ -30761,44 +30761,13 @@ ix86_adjust_cost (rtx_insn *insn, int de
 static int
 ia32_multipass_dfa_lookahead (void)
 {
-  switch (ix86_tune)
-    {
-    case PROCESSOR_PENTIUM:
-    case PROCESSOR_LAKEMONT:
-      return 2;
-
-    case PROCESSOR_PENTIUMPRO:
-    case PROCESSOR_K6:
-      return 1;
-
-    case PROCESSOR_BDVER1:
-    case PROCESSOR_BDVER2:
-    case PROCESSOR_BDVER3:
-    case PROCESSOR_BDVER4:
-      /* We use lookahead value 4 for BD both before and after reload
-	 schedules. Plan is to have value 8 included for O3. */
-        return 4;
-
-    case PROCESSOR_CORE2:
-    case PROCESSOR_NEHALEM:
-    case PROCESSOR_SANDYBRIDGE:
-    case PROCESSOR_HASWELL:
-    case PROCESSOR_BONNELL:
-    case PROCESSOR_SILVERMONT:
-    case PROCESSOR_KNL:
-    case PROCESSOR_KNM:
-    case PROCESSOR_INTEL:
-      /* Generally, we want haifa-sched:max_issue() to look ahead as far
-	 as many instructions can be executed on a cycle, i.e.,
-	 issue_rate.  I wonder why tuning for many CPUs does not do this.  */
-      if (reload_completed)
-        return ix86_issue_rate ();
-      /* Don't use lookahead for pre-reload schedule to save compile time.  */
-      return 0;
-
-    default:
-      return 0;
-    }
+  /* Generally, we want haifa-sched:max_issue() to look ahead as far
+     as many instructions can be executed on a cycle, i.e.,
+     issue_rate.  */
+  if (reload_completed)
+    return ix86_issue_rate ();
+  /* Don't use lookahead for pre-reload schedule to save compile time.  */
+  return 0;
 }
 
 /* Return true if target platform supports macro-fusion.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]