+2019-11-12 Martin Liska <mliska@suse.cz>
+
+ * 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 <mliska@suse.cz>
* common/common-target.def:
"",
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,
return vec<const char *> ();
}
-/* 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 }
location_t);
extern vec<const char *> 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
#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
{ 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.
#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;
#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 }
};
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
{
/* 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 }
};
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'. */
#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
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 }
};
#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'. */
#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
{
{ 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 }
};
}
}
-/* 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
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,
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
@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