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]

[vta, vta4.4] turn -fmin-insn-uid into --param min-nondebug-insn-uid


As requested by various parties.

I'm installing these in the VTA branches (the second patch is for the
vta 4.4 branch), and merging it into the VTA patchset.

for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* doc/invoke.texi (-fmin-insn-uid): Changed to...
	(param min-nondebug-insn-uid): ... this.
	* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
	* params.h (MIN_NONDEBUG_INSN_UID): New.
	* emit-rtl.c: Include params.h.  Replace flag_min_insn_uid with
	MIN_NONDEBUG_INSN_UID.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi.orig	2009-06-15 21:53:34.000000000 -0300
+++ gcc/doc/invoke.texi	2009-06-16 02:51:10.000000000 -0300
@@ -304,8 +304,7 @@ Objective-C and Objective-C++ Dialects}.
 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
--fmem-report -fmin-insn-uid=@var{uid} @gol
--fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
+-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
 -ftest-coverage  -ftime-report -fvar-tracking @gol
@@ -4554,14 +4553,6 @@ pass when it finishes.
 Makes the compiler print some statistics about permanent memory
 allocation when it finishes.
 
-@item -fmin-insn-uid=@var{uid}
-@opindex fmin-insn-uid
-Use uids starting at @var{uid} for non-debug insns created by
-@option{-fvar-tracking-assignments}.  The range below @var{uid} is
-reserved exclusively for debug insns, but debug insns may get
-(non-overlapping) uids above @var{uid} if the reserved range is
-exhausted.
-
 @item -fpre-ipa-mem-report
 @opindex fpre-ipa-mem-report
 @item -fpost-ipa-mem-report
@@ -7982,6 +7973,12 @@ with more basic blocks than this paramet
 motion optimization performed on them.  The default value of the
 parameter is 1000 for -O1 and 10000 for -O2 and above.
 
+@item min-nondebug-insn-uid
+Use uids starting at this parameter for nondebug insns.  The range below
+the parameter is reserved exclusively for debug insns created by
+@option{-fvar-tracking-assignments}, but debug insns may get
+(non-overlapping) uids above it if the reserved range is exhausted.
+
 @end table
 @end table
 
Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c.orig	2009-06-15 21:53:34.000000000 -0300
+++ gcc/emit-rtl.c	2009-06-16 01:08:10.000000000 -0300
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3.  
 #include "langhooks.h"
 #include "tree-pass.h"
 #include "df.h"
+#include "params.h"
 
 /* Commonly used modes.  */
 
@@ -2314,15 +2315,15 @@ set_new_first_and_last_insn (rtx first, 
   last_insn = last;
   cur_insn_uid = 0;
 
-  if (flag_min_insn_uid || MAY_HAVE_DEBUG_INSNS)
+  if (MIN_NONDEBUG_INSN_UID || MAY_HAVE_DEBUG_INSNS)
     {
       int debug_count = 0;
 
-      cur_insn_uid = flag_min_insn_uid - 1;
+      cur_insn_uid = MIN_NONDEBUG_INSN_UID - 1;
       cur_debug_insn_uid = 0;
 
       for (insn = first; insn; insn = NEXT_INSN (insn))
-	if (INSN_UID (insn) < flag_min_insn_uid)
+	if (INSN_UID (insn) < MIN_NONDEBUG_INSN_UID)
 	  cur_debug_insn_uid = MAX (cur_debug_insn_uid, INSN_UID (insn));
 	else
 	  {
@@ -2332,7 +2333,7 @@ set_new_first_and_last_insn (rtx first, 
 	  }
 
       if (debug_count)
-	cur_debug_insn_uid = flag_min_insn_uid + debug_count;
+	cur_debug_insn_uid = MIN_NONDEBUG_INSN_UID + debug_count;
       else
 	cur_debug_insn_uid++;
     }
@@ -3032,10 +3033,10 @@ get_max_insn_count (void)
      differences due to debug insns, and not be affected by
      -fmin-insn-uid, to avoid excessive table size and to simplify
      debugging of -fcompare-debug failures.  */
-  if (cur_debug_insn_uid > flag_min_insn_uid)
+  if (cur_debug_insn_uid > MIN_NONDEBUG_INSN_UID)
     n -= cur_debug_insn_uid;
   else
-    n -= flag_min_insn_uid;
+    n -= MIN_NONDEBUG_INSN_UID;
 
   return n;
 }
@@ -3615,7 +3616,7 @@ make_debug_insn_raw (rtx pattern)
 
   insn = rtx_alloc (DEBUG_INSN);
   INSN_UID (insn) = cur_debug_insn_uid++;
-  if (cur_debug_insn_uid > flag_min_insn_uid)
+  if (cur_debug_insn_uid > MIN_NONDEBUG_INSN_UID)
     INSN_UID (insn) = cur_insn_uid++;
 
   PATTERN (insn) = pattern;
@@ -5520,11 +5521,8 @@ init_emit (void)
 {
   first_insn = NULL;
   last_insn = NULL;
-  if (flag_min_insn_uid)
-    {
-      cur_insn_uid = flag_min_insn_uid;
-      gcc_assert (flag_min_insn_uid > 0);
-    }
+  if (MIN_NONDEBUG_INSN_UID)
+    cur_insn_uid = MIN_NONDEBUG_INSN_UID;
   else
     cur_insn_uid = 1;
   cur_debug_insn_uid = 1;
Index: gcc/params.def
===================================================================
--- gcc/params.def.orig	2009-06-15 21:53:34.000000000 -0300
+++ gcc/params.def	2009-06-16 01:08:10.000000000 -0300
@@ -757,6 +757,13 @@ DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_I
 	  "max basic blocks number in loop for loop invariant motion",
 	  10000, 0, 0)
 
+/* Set minimum insn uid for non-debug insns.  */
+
+DEFPARAM (PARAM_MIN_NONDEBUG_INSN_UID,
+	  "min-nondebug-insn-uid",
+	  "The minimum UID to be used for a nondebug insn",
+	  0, 1, 0)
+
 /*
 Local variables:
 mode:c
Index: gcc/params.h
===================================================================
--- gcc/params.h.orig	2009-06-15 21:53:34.000000000 -0300
+++ gcc/params.h	2009-06-16 01:08:10.000000000 -0300
@@ -170,4 +170,6 @@ typedef enum compiler_param
   PARAM_VALUE (PARAM_SWITCH_CONVERSION_BRANCH_RATIO)
 #define LOOP_INVARIANT_MAX_BBS_IN_LOOP \
   PARAM_VALUE (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP)
+#define MIN_NONDEBUG_INSN_UID \
+  PARAM_VALUE (PARAM_MIN_NONDEBUG_INSN_UID)
 #endif /* ! GCC_PARAMS_H */
for  gcc/ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* doc/invoke.texi (-fmin-insn-uid): Changed to...
	(param min-nondebug-insn-uid): ... this.
	* params.def (PARAM_MIN_NONDEBUG_INSN_UID): New.
	* params.h (MIN_NONDEBUG_INSN_UID): New.
	* emit-rtl.c: Include params.h.  Replace flag_min_insn_uid with
	MIN_NONDEBUG_INSN_UID.

Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi.orig	2009-06-16 01:08:49.000000000 -0300
+++ gcc/doc/invoke.texi	2009-06-16 02:52:42.000000000 -0300
@@ -304,8 +304,7 @@ Objective-C and Objective-C++ Dialects}.
 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
 -feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
--fmem-report -fmin-insn-uid=@var{uid} @gol
--fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
+-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
 -ftest-coverage  -ftime-report -fvar-tracking @gol
@@ -4515,14 +4514,6 @@ pass when it finishes.
 Makes the compiler print some statistics about permanent memory
 allocation when it finishes.
 
-@item -fmin-insn-uid=@var{uid}
-@opindex fmin-insn-uid
-Use uids starting at @var{uid} for non-debug insns created by
-@option{-fvar-tracking-assignments}.  The range below @var{uid} is
-reserved exclusively for debug insns, but debug insns may get
-(non-overlapping) uids above @var{uid} if the reserved range is
-exhausted.
-
 @item -fpre-ipa-mem-report
 @opindex fpre-ipa-mem-report
 @item -fpost-ipa-mem-report
@@ -7901,6 +7892,12 @@ with more basic blocks than this paramet
 motion optimization performed on them.  The default value of the
 parameter is 1000 for -O1 and 10000 for -O2 and above.
 
+@item min-nondebug-insn-uid
+Use uids starting at this parameter for nondebug insns.  The range below
+the parameter is reserved exclusively for debug insns created by
+@option{-fvar-tracking-assignments}, but debug insns may get
+(non-overlapping) uids above it if the reserved range is exhausted.
+
 @end table
 @end table
 
Index: gcc/emit-rtl.c
===================================================================
--- gcc/emit-rtl.c.orig	2009-06-16 01:08:49.000000000 -0300
+++ gcc/emit-rtl.c	2009-06-16 01:10:22.000000000 -0300
@@ -58,6 +58,7 @@ along with GCC; see the file COPYING3.  
 #include "langhooks.h"
 #include "tree-pass.h"
 #include "df.h"
+#include "params.h"
 
 /* Commonly used modes.  */
 
@@ -2322,13 +2323,13 @@ set_new_first_and_last_insn (rtx first, 
   last_insn = last;
   cur_insn_uid = 0;
 
-  if (flag_min_insn_uid)
+  if (MIN_NONDEBUG_INSN_UID)
     {
-      cur_insn_uid = flag_min_insn_uid - 1;
+      cur_insn_uid = MIN_NONDEBUG_INSN_UID - 1;
       cur_debug_insn_uid = 0;
 
       for (insn = first; insn; insn = NEXT_INSN (insn))
-	if (INSN_UID (insn) < flag_min_insn_uid)
+	if (INSN_UID (insn) < MIN_NONDEBUG_INSN_UID)
 	  cur_debug_insn_uid = MAX (cur_debug_insn_uid, INSN_UID (insn));
 	else
 	  cur_insn_uid = MAX (cur_insn_uid, INSN_UID (insn));
@@ -3592,7 +3593,7 @@ make_debug_insn_raw (rtx pattern)
   rtx insn;
 
   insn = rtx_alloc (DEBUG_INSN);
-  INSN_UID (insn) = cur_debug_insn_uid < flag_min_insn_uid
+  INSN_UID (insn) = cur_debug_insn_uid < MIN_NONDEBUG_INSN_UID
     ? cur_debug_insn_uid++
     : cur_insn_uid++;
 
@@ -5498,8 +5499,8 @@ init_emit (void)
 {
   first_insn = NULL;
   last_insn = NULL;
-  if (flag_min_insn_uid)
-    cur_insn_uid = flag_min_insn_uid;
+  if (MIN_NONDEBUG_INSN_UID)
+    cur_insn_uid = MIN_NONDEBUG_INSN_UID;
   else
     cur_insn_uid = 1;
   cur_debug_insn_uid = 1;
Index: gcc/params.def
===================================================================
--- gcc/params.def.orig	2009-06-16 01:08:49.000000000 -0300
+++ gcc/params.def	2009-06-16 01:10:22.000000000 -0300
@@ -771,6 +771,13 @@ DEFPARAM (PARAM_LOOP_INVARIANT_MAX_BBS_I
 	  "max basic blocks number in loop for loop invariant motion",
 	  10000, 0, 0)
 
+/* Set minimum insn uid for non-debug insns.  */
+
+DEFPARAM (PARAM_MIN_NONDEBUG_INSN_UID,
+	  "min-nondebug-insn-uid",
+	  "The minimum UID to be used for a nondebug insn",
+	  0, 1, 0)
+
 /*
 Local variables:
 mode:c
Index: gcc/params.h
===================================================================
--- gcc/params.h.orig	2009-06-16 01:08:49.000000000 -0300
+++ gcc/params.h	2009-06-16 01:10:22.000000000 -0300
@@ -176,4 +176,6 @@ typedef enum compiler_param
   PARAM_VALUE (PARAM_SWITCH_CONVERSION_BRANCH_RATIO)
 #define LOOP_INVARIANT_MAX_BBS_IN_LOOP \
   PARAM_VALUE (PARAM_LOOP_INVARIANT_MAX_BBS_IN_LOOP)
+#define MIN_NONDEBUG_INSN_UID \
+  PARAM_VALUE (PARAM_MIN_NONDEBUG_INSN_UID)
 #endif /* ! GCC_PARAMS_H */
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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