Fix overflow issues with new --params

Message ID 20190209175843.fvtf7bxxzawqxfbf@kam.mff.cuni.cz
State New
Headers show
Series
  • Fix overflow issues with new --params
Related show

Commit Message

Jan Hubicka Feb. 9, 2019, 5:58 p.m.
Hi,
as demonstrated in the PR, adding using verly large values for
uninlined-function-insns and friends leads to overflow.  It is easiest
to handle this by artificial upper bound on the parameter.

I can imagine that for some architectures, like GCN, function calls can
be considered expensvie but not more than 1M of instructions :)

Bootstrapped/regtested x86_64-linux and comitted.
	PR ipa/88755
	* params.def (uninlined-function-insns, uninlined-function-time,
	uninlined-thunk-insns, uninlined-thunk-time): Add artificial upper
	bound so we don't get overflows.

Patch

Index: params.def
===================================================================
--- params.def	(revision 268722)
+++ params.def	(working copy)
@@ -96,23 +96,23 @@  DEFPARAM (PARAM_UNINLINED_FUNCTION_INSNS
 	  "uninlined-function-insns",
 	  "Instruction accounted for function prologue, epilogue and other"
 	  " overhead.",
-	  2, 0, 0)
+	  2, 0, 1000000)
 
 DEFPARAM (PARAM_UNINLINED_FUNCTION_TIME,
 	  "uninlined-function-time",
 	  "Time accounted for function prologue, epilogue and other"
 	  " overhead.",
-	  0, 0, 0)
+	  0, 0, 1000000)
 
 DEFPARAM (PARAM_UNINLINED_FUNCTION_THUNK_INSNS,
 	  "uninlined-thunk-insns",
 	  "Instruction accounted for function thunk overhead.",
-	  2, 0, 0)
+	  2, 0, 1000000)
 
 DEFPARAM (PARAM_UNINLINED_FUNCTION_THUNK_TIME,
 	  "uninlined-thunk-time",
 	  "Time accounted for function thunk overhead.",
-	  2, 0, 0)
+	  2, 0, 1000000)
 
 DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE,
 	  "max-inline-insns-recursive",