From 8100e93b72dfe82c5f084a3d9351b8ad2ef6ab39 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 12 Nov 2019 11:10:44 +0100 Subject: [PATCH] Remove option_default_params and option_validate_param hooks. 2019-11-12 Martin Liska * common/common-target.def: Remove option_validate_param and option_default_params. * common/common-targhooks.c (default_option_validate_param): Remove. * common/common-targhooks.h (default_option_validate_param): Remove. * common/config/aarch64/aarch64-common.c (TARGET_OPTION_DEFAULT_PARAMS): Remove usage of this. (TARGET_OPTION_VALIDATE_PARAM): Likewise. (aarch64_option_validate_param): Likewise. (aarch64_option_default_params): Likewise * common/config/bpf/bpf-common.c (bpf_option_default_params): Likewise. (TARGET_OPTION_DEFAULT_PARAMS): Likewise. * common/config/ia64/ia64-common.c (ia64_option_default_params): Likewise. (TARGET_OPTION_DEFAULT_PARAMS): Likewise. * common/config/powerpcspe/powerpcspe-common.c (rs6000_option_default_params): Likewise. (TARGET_OPTION_DEFAULT_PARAMS): Likewise. * common/config/rs6000/rs6000-common.c (rs6000_option_default_params): Likewise. (TARGET_OPTION_DEFAULT_PARAMS): Likewise. * common/config/sh/sh-common.c (sh_option_default_params): Likewise. (TARGET_OPTION_DEFAULT_PARAMS): Likewise. * config/aarch64/aarch64.c (aarch64_override_options_internal): Validate guard_size here. * doc/tm.texi: Remove option_default_params and option_validate_param. * doc/tm.texi.in: Likewise. From-SVN: r278090 --- gcc/ChangeLog | 28 ++++++++++++++ gcc/common/common-target.def | 12 ------ gcc/common/common-targhooks.c | 9 ----- gcc/common/common-targhooks.h | 2 - gcc/common/config/aarch64/aarch64-common.c | 47 ++---------------------- gcc/common/config/bpf/bpf-common.c | 13 ------- gcc/common/config/ia64/ia64-common.c | 25 ++++--------- gcc/common/config/powerpcspe/powerpcspe-common.c | 14 +------ gcc/common/config/rs6000/rs6000-common.c | 15 ++------ gcc/common/config/sh/sh-common.c | 10 +---- gcc/config/aarch64/aarch64.c | 12 +++--- gcc/doc/tm.texi | 8 ---- gcc/doc/tm.texi.in | 4 -- 13 files changed, 50 insertions(+), 149 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 56f6d7e..0c9da29 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,33 @@ 2019-11-12 Martin Liska + * common/common-target.def: Remove option_validate_param and + option_default_params. + * common/common-targhooks.c (default_option_validate_param): + Remove. + * common/common-targhooks.h (default_option_validate_param): + Remove. + * common/config/aarch64/aarch64-common.c (TARGET_OPTION_DEFAULT_PARAMS): + Remove usage of this. + (TARGET_OPTION_VALIDATE_PARAM): Likewise. + (aarch64_option_validate_param): Likewise. + (aarch64_option_default_params): Likewise + * common/config/bpf/bpf-common.c (bpf_option_default_params): Likewise. + (TARGET_OPTION_DEFAULT_PARAMS): Likewise. + * common/config/ia64/ia64-common.c (ia64_option_default_params): Likewise. + (TARGET_OPTION_DEFAULT_PARAMS): Likewise. + * common/config/powerpcspe/powerpcspe-common.c (rs6000_option_default_params): Likewise. + (TARGET_OPTION_DEFAULT_PARAMS): Likewise. + * common/config/rs6000/rs6000-common.c (rs6000_option_default_params): Likewise. + (TARGET_OPTION_DEFAULT_PARAMS): Likewise. + * common/config/sh/sh-common.c (sh_option_default_params): Likewise. + (TARGET_OPTION_DEFAULT_PARAMS): Likewise. + * config/aarch64/aarch64.c (aarch64_override_options_internal): Validate + guard_size here. + * doc/tm.texi: Remove option_default_params and option_validate_param. + * doc/tm.texi.in: Likewise. + +2019-11-12 Martin Liska + * common/common-target.def: Do not mention set_default_param_value and set_param_value. diff --git a/gcc/common/common-target.def b/gcc/common/common-target.def index 4809672..de5e1c2 100644 --- a/gcc/common/common-target.def +++ b/gcc/common/common-target.def @@ -49,18 +49,6 @@ DEFHOOKPOD "", const struct default_options *, empty_optimization_table) -DEFHOOK -(option_default_params, -"Set target-dependent default values for @option{--param} settings.", - void, (void), - hook_void_void) - -DEFHOOK -(option_validate_param, -"Validate target-dependent value for @option{--param} settings.", - bool, (int, int), - default_option_validate_param) - /* The initial value of target_flags. */ DEFHOOKPOD (default_target_flags, diff --git a/gcc/common/common-targhooks.c b/gcc/common/common-targhooks.c index 9ed7822..41626ba 100644 --- a/gcc/common/common-targhooks.c +++ b/gcc/common/common-targhooks.c @@ -86,15 +86,6 @@ default_get_valid_option_values (int, const char *) return vec (); } -/* Default version of TARGET_OPTION_VALIDATE_PARAM. */ - -bool -default_option_validate_param (const int value ATTRIBUTE_UNUSED, - const int param ATTRIBUTE_UNUSED) -{ - return true; -} - const struct default_options empty_optimization_table[] = { { OPT_LEVELS_NONE, 0, NULL, 0 } diff --git a/gcc/common/common-targhooks.h b/gcc/common/common-targhooks.h index 18cfb5a..af0bffe 100644 --- a/gcc/common/common-targhooks.h +++ b/gcc/common/common-targhooks.h @@ -30,8 +30,6 @@ extern bool default_target_handle_option (struct gcc_options *, location_t); extern vec default_get_valid_option_values (int, const char *); -extern bool default_option_validate_param (const int, const int); - extern const struct default_options empty_optimization_table[]; #endif diff --git a/gcc/common/config/aarch64/aarch64-common.c b/gcc/common/config/aarch64/aarch64-common.c index b4ba670..7e966f8 100644 --- a/gcc/common/config/aarch64/aarch64-common.c +++ b/gcc/common/config/aarch64/aarch64-common.c @@ -41,10 +41,6 @@ #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE aarch_option_optimization_table -#undef TARGET_OPTION_DEFAULT_PARAMS -#define TARGET_OPTION_DEFAULT_PARAMS aarch64_option_default_params -#undef TARGET_OPTION_VALIDATE_PARAM -#define TARGET_OPTION_VALIDATE_PARAM aarch64_option_validate_param #undef TARGET_OPTION_INIT_STRUCT #define TARGET_OPTION_INIT_STRUCT aarch64_option_init_struct @@ -63,49 +59,12 @@ static const struct default_options aarch_option_optimization_table[] = { OPT_LEVELS_ALL, OPT_fasynchronous_unwind_tables, NULL, 1 }, { OPT_LEVELS_ALL, OPT_funwind_tables, NULL, 1}, #endif + { OPT_LEVELS_ALL, OPT__param_stack_clash_protection_guard_size_, NULL, + DEFAULT_STK_CLASH_GUARD_SIZE == 0 ? 16 : DEFAULT_STK_CLASH_GUARD_SIZE }, + { OPT_LEVELS_NONE, 0, NULL, 0 } }; -/* Implement target validation TARGET_OPTION_DEFAULT_PARAM. */ - -static bool -aarch64_option_validate_param (const int value, const int param) -{ - /* Check that both parameters are the same. */ - if (param == param_stack_clash_protection_guard_size) - { - if (value != 12 && value != 16) - { - error ("only values 12 (4 KB) and 16 (64 KB) are supported for guard " - "size. Given value %d (%llu KB) is out of range", - value, (1ULL << value) / 1024ULL); - return false; - } - } - - return true; -} - -/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ - -static void -aarch64_option_default_params (void) -{ - /* We assume the guard page is 64k. */ - int index = (int) param_stack_clash_protection_guard_size; - param_stack_clash_protection_guard_size - = (DEFAULT_STK_CLASH_GUARD_SIZE == 0 ? 16 : DEFAULT_STK_CLASH_GUARD_SIZE); - - int guard_size = param_stack_clash_protection_guard_size; - - /* Set the interval parameter to be the same as the guard size. This way the - mid-end code does the right thing for us. */ - param_stack_clash_protection_probe_interval = guard_size; - - /* Validate the options. */ - aarch64_option_validate_param (guard_size, index); -} - /* Implement TARGET_HANDLE_OPTION. This function handles the target specific options for CPU/target selection. diff --git a/gcc/common/config/bpf/bpf-common.c b/gcc/common/config/bpf/bpf-common.c index 0d04f21..bd73933 100644 --- a/gcc/common/config/bpf/bpf-common.c +++ b/gcc/common/config/bpf/bpf-common.c @@ -39,17 +39,4 @@ static const struct default_options bpf_option_optimization_table[] = #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE bpf_option_optimization_table -/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ - -static void -bpf_option_default_params (void) -{ - /* XXX large-stack-frame = 512 bytes */ - /* XXX max-unrolled-insns */ - /* XXX max-unroll-times */ -} - -#undef TARGET_OPTION_DEFAULT_PARAMS -#define TARGET_OPTION_DEFAULT_PARAMS bpf_option_default_params - struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER; diff --git a/gcc/common/config/ia64/ia64-common.c b/gcc/common/config/ia64/ia64-common.c index a9ff295..899cbb9 100644 --- a/gcc/common/config/ia64/ia64-common.c +++ b/gcc/common/config/ia64/ia64-common.c @@ -35,6 +35,14 @@ static const struct default_options ia64_option_optimization_table[] = #ifdef SUBTARGET_OPTIMIZATION_OPTIONS SUBTARGET_OPTIMIZATION_OPTIONS, #endif + + /* Let the scheduler form additional regions. */ + { OPT_LEVELS_ALL, OPT__param_max_sched_extend_regions_iters_, NULL, 2 }, + /* Set the default values for cache-related parameters. */ + { OPT_LEVELS_ALL, OPT__param_simultaneous_prefetches_, NULL, 6 }, + { OPT_LEVELS_ALL, OPT__param_l1_cache_line_size_ , NULL, 32}, + { OPT_LEVELS_ALL, OPT__param_sched_mem_true_dep_cost_, NULL, 4 }, + { OPT_LEVELS_NONE, 0, NULL, 0 } }; @@ -81,25 +89,8 @@ ia64_except_unwind_info (struct gcc_options *opts) return UI_TARGET; } -/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ - -static void -ia64_option_default_params (void) -{ - /* Let the scheduler form additional regions. */ - param_max_sched_extend_regions_iters = 2; - - /* Set the default values for cache-related parameters. */ - param_simultaneous_prefetches = 6; - param_l1_cache_line_size = 32; - - param_sched_mem_true_dep_cost = 4; -} - #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE ia64_option_optimization_table -#undef TARGET_OPTION_DEFAULT_PARAMS -#define TARGET_OPTION_DEFAULT_PARAMS ia64_option_default_params #undef TARGET_EXCEPT_UNWIND_INFO #define TARGET_EXCEPT_UNWIND_INFO ia64_except_unwind_info diff --git a/gcc/common/config/powerpcspe/powerpcspe-common.c b/gcc/common/config/powerpcspe/powerpcspe-common.c index 8976425..2ec5d9a 100644 --- a/gcc/common/config/powerpcspe/powerpcspe-common.c +++ b/gcc/common/config/powerpcspe/powerpcspe-common.c @@ -32,6 +32,8 @@ static const struct default_options rs6000_option_optimization_table[] = { /* Enable -fsched-pressure for first pass instruction scheduling. */ { OPT_LEVELS_1_PLUS, OPT_fsched_pressure, NULL, 1 }, + /* Double growth factor to counter reduced min jump length. */ + { OPT_LEVELS_ALL, OPT__param_max_grow_copy_bb_insns_, NULL, 16 }, { OPT_LEVELS_NONE, 0, NULL, 0 } }; @@ -50,15 +52,6 @@ rs6000_option_init_struct (struct gcc_options *opts) opts->x_flag_section_anchors = 1; } -/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ - -static void -rs6000_option_default_params (void) -{ - /* Double growth factor to counter reduced min jump length. */ - param_max_grow_copy_bb_insns = 16; -} - /* If not otherwise specified by a target, make 'long double' equivalent to 'double'. */ @@ -319,9 +312,6 @@ rs6000_supports_split_stack (bool report, #undef TARGET_OPTION_INIT_STRUCT #define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct -#undef TARGET_OPTION_DEFAULT_PARAMS -#define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params - #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table diff --git a/gcc/common/config/rs6000/rs6000-common.c b/gcc/common/config/rs6000/rs6000-common.c index 250eca7..eb0328d 100644 --- a/gcc/common/config/rs6000/rs6000-common.c +++ b/gcc/common/config/rs6000/rs6000-common.c @@ -42,6 +42,9 @@ static const struct default_options rs6000_option_optimization_table[] = turn them off. */ { OPT_LEVELS_ALL, OPT_fweb, NULL, 0 }, { OPT_LEVELS_ALL, OPT_frename_registers, NULL, 0 }, + + /* Double growth factor to counter reduced min jump length. */ + { OPT_LEVELS_ALL, OPT__param_max_grow_copy_bb_insns_, NULL, 16 }, { OPT_LEVELS_NONE, 0, NULL, 0 } }; @@ -69,15 +72,6 @@ rs6000_option_init_struct (struct gcc_options *opts) #endif } -/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ - -static void -rs6000_option_default_params (void) -{ - /* Double growth factor to counter reduced min jump length. */ - param_max_grow_copy_bb_insns = 16; -} - /* If not otherwise specified by a target, make 'long double' equivalent to 'double'. */ @@ -271,9 +265,6 @@ rs6000_supports_split_stack (bool report, #undef TARGET_OPTION_INIT_STRUCT #define TARGET_OPTION_INIT_STRUCT rs6000_option_init_struct -#undef TARGET_OPTION_DEFAULT_PARAMS -#define TARGET_OPTION_DEFAULT_PARAMS rs6000_option_default_params - #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE rs6000_option_optimization_table diff --git a/gcc/common/config/sh/sh-common.c b/gcc/common/config/sh/sh-common.c index 104b1b4..f195753 100644 --- a/gcc/common/config/sh/sh-common.c +++ b/gcc/common/config/sh/sh-common.c @@ -31,6 +31,7 @@ static const struct default_options sh_option_optimization_table[] = { { OPT_LEVELS_SIZE, OPT_mdiv_, SH_DIV_STR_FOR_SIZE, 1 }, { OPT_LEVELS_0_ONLY, OPT_mdiv_, "", 1 }, + { OPT_LEVELS_ALL, OPT__param_simultaneous_prefetches_, NULL, 2 }, { OPT_LEVELS_NONE, 0, NULL, 0 } }; @@ -144,17 +145,8 @@ sh_handle_option (struct gcc_options *opts, } } -/* Implement TARGET_OPTION_DEFAULT_PARAMS. */ -static void -sh_option_default_params (void) -{ - param_simultaneous_prefetches = 2; -} - #undef TARGET_OPTION_OPTIMIZATION_TABLE #define TARGET_OPTION_OPTIMIZATION_TABLE sh_option_optimization_table -#undef TARGET_OPTION_DEFAULT_PARAMS -#define TARGET_OPTION_DEFAULT_PARAMS sh_option_default_params #undef TARGET_DEFAULT_TARGET_FLAGS #define TARGET_DEFAULT_TARGET_FLAGS TARGET_DEFAULT #undef TARGET_HANDLE_OPTION diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 78e6bc0..d2a3c7e 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -13340,16 +13340,14 @@ aarch64_override_options_internal (struct gcc_options *opts) param_sched_pressure_algorithm, SCHED_PRESSURE_MODEL); - /* If the user hasn't changed it via configure then set the default to 64 KB - for the backend. */ - SET_OPTION_IF_UNSET (opts, &global_options_set, - param_stack_clash_protection_guard_size, - (DEFAULT_STK_CLASH_GUARD_SIZE == 0 - ? 16 : DEFAULT_STK_CLASH_GUARD_SIZE)); - /* Validate the guard size. */ int guard_size = param_stack_clash_protection_guard_size; + if (guard_size != 12 && guard_size != 16) + error ("only values 12 (4 KB) and 16 (64 KB) are supported for guard " + "size. Given value %d (%llu KB) is out of range", + guard_size, (1ULL << guard_size) / 1024ULL); + /* Enforce that interval is the same size as size so the mid-end does the right thing. */ SET_OPTION_IF_UNSET (opts, &global_options_set, diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index f6bc31b..11c236e 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -758,14 +758,6 @@ options are changed via @code{#pragma GCC optimize} or by using the Set target-dependent initial values of fields in @var{opts}. @end deftypefn -@deftypefn {Common Target Hook} void TARGET_OPTION_DEFAULT_PARAMS (void) -Set target-dependent default values for @option{--param} settings. -@end deftypefn - -@deftypefn {Common Target Hook} bool TARGET_OPTION_VALIDATE_PARAM (int, @var{int}) -Validate target-dependent value for @option{--param} settings. -@end deftypefn - @defmac SWITCHABLE_TARGET Some targets need to switch between substantially different subtargets during compilation. For example, the MIPS target has one subtarget for diff --git a/gcc/doc/tm.texi.in b/gcc/doc/tm.texi.in index 2739e9c..b8c41b5 100644 --- a/gcc/doc/tm.texi.in +++ b/gcc/doc/tm.texi.in @@ -736,10 +736,6 @@ options are changed via @code{#pragma GCC optimize} or by using the @hook TARGET_OPTION_INIT_STRUCT -@hook TARGET_OPTION_DEFAULT_PARAMS - -@hook TARGET_OPTION_VALIDATE_PARAM - @defmac SWITCHABLE_TARGET Some targets need to switch between substantially different subtargets during compilation. For example, the MIPS target has one subtarget for -- 2.7.4