This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
How to set params under option?
- From: Konstantin Vladimirov <konstantin dot vladimirov at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 1 Aug 2012 11:25:29 +0400
- Subject: How to set params under option?
Hi,
Working on private backend. Need to add some knobs to tune inlining.
Code (with name of backend substituted to "my"):
in my.c file:
#undef TARGET_OPTION_DEFAULT_PARAMS
#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:
heur-function-growth=
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)
heur-module-growth=
Target RejectNegative Joined UInteger Var(my_module_growth) Init(30)
Acceptable module growth as a result of inlining in percents (30% by default)
heur-large-function-size=
Target RejectNegative Joined UInteger Var(my_large_function_size) Init(2700)
Size in instructions of function that considered to be large (2700 by default)
heur-large-module-size=
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