This is the mail archive of the 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]

How to set params under option?


Working on private backend. Need to add some knobs to tune inlining.
Code (with name of backend substituted to "my"):

in my.c file:

#define TARGET_OPTION_DEFAULT_PARAMS my_option_default_params

static void
my_option_default_params (void)
  my_log("Large function size = %d\n", my_large_function_size);
  my_log("Function growth = %d\n", my_function_growth);
  my_log("Large module size = %d\n", my_large_module_size);
  my_log("Module growth = %d\n", my_module_growth);

  set_default_param_value(PARAM_LARGE_FUNCTION_INSNS, my_large_function_size);
  set_default_param_value(PARAM_LARGE_FUNCTION_GROWTH, my_function_growth);
  set_default_param_value(PARAM_LARGE_UNIT_INSNS, my_large_module_size);
  set_default_param_value(PARAM_INLINE_UNIT_GROWTH, my_module_growth);

in my.opt file:

Target RejectNegative Joined UInteger Var(my_function_growth) Init(100)
Acceptable large (see below what means large) function growth as a
result of inlining in percents (100% by default)

Target RejectNegative Joined UInteger Var(my_module_growth) Init(30)
Acceptable module growth as a result of inlining in percents (30% by default)

Target RejectNegative Joined UInteger Var(my_large_function_size) Init(2700)
Size in instructions of function that considered to be large (2700 by default)

Target RejectNegative Joined UInteger Var(my_large_module_size) Init(10000)
Size in instructions of module, that is considered to be large (10000
by default)

But in the log output all values in my_option_default_params function
are zeros. Under debugger I can see that it is called earlier, than my
options initialized. Are there any other ways to make such knobs?

With best regards, Konstantin

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