[patch, rfc] add case-values-threshold as a param

Eric Christopher echristo@redhat.com
Tue Oct 12 22:19:00 GMT 2004


This changes it from a #define to a parameter - but only if the backend
hasn't already defined it. The only functional difference here is that I
was unable to keep the conditional on HAVE_casesi to determine the
default value so I left it at 6, unless someone has an idea there. I was
trying to keep the changes minimal.

Thoughts? OK?

-eric

-- 
Eric Christopher <echristo@redhat.com>

2004-10-12  Eric Christopher  <echristo@redhat.com>

	* params.def: Add PARAMS_CASE_VALUE_THRESHOLD.
	* expr.c: Use. Include params.h.

Index: expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/expr.c,v
retrieving revision 1.726
diff -u -p -w -r1.726 expr.c
--- expr.c	3 Oct 2004 22:50:18 -0000	1.726
+++ expr.c	12 Oct 2004 21:22:19 -0000
@@ -28,6 +28,7 @@ Software Foundation, 59 Temple Place - S
 #include "rtl.h"
 #include "tree.h"
 #include "flags.h"
+#include "params.h"
 #include "regs.h"
 #include "hard-reg-set.h"
 #include "except.h"
@@ -8701,7 +8702,7 @@ do_store_flag (tree exp, rtx target, enu
    this means extra overhead for dispatch tables, which raises the
    threshold for using them.  */
 #ifndef CASE_VALUES_THRESHOLD
-#define CASE_VALUES_THRESHOLD (HAVE_casesi ? 4 : 5)
+#define CASE_VALUES_THRESHOLD PARAM_VALUE (PARAM_CASE_VALUES_THRESHOLD)
 #endif /* CASE_VALUES_THRESHOLD */
 
 unsigned int
Index: params.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/params.def,v
retrieving revision 1.46
diff -u -p -w -r1.46 params.def
--- params.def	5 Sep 2004 09:25:26 -0000	1.46
+++ params.def	12 Oct 2004 21:22:19 -0000
@@ -404,6 +404,12 @@ DEFPARAM (PARAM_INTEGER_SHARE_LIMIT,
 	  "The upper bound for sharing integer constants",
 	  256)
 
+/* CASE_VALUES_THRESHOLD affects when we use dispatch tables for
+   case comparisons.  */
+DEFPARAM (PARAM_CASE_VALUES_THRESHOLD,
+	  "case-values-threshold",
+	  "maximum number of values in a case statement",
+	  6)
 /*
 Local variables:
 mode:c




More information about the Gcc-patches mailing list