From 84f6cc404bf347240a73be17f0b76fabd41e26ed Mon Sep 17 00:00:00 2001 From: hubicka Date: Sun, 1 Sep 2013 15:14:24 +0000 Subject: * common.opt (fdevirtualize-speculatively): New function. * invoke.texi (fdevirtualize-speculatively): Document. * ipa-devirt.c: Include ipa-inline.h (likely_target_p): New function. (ipa_devirt): New function. (gate_ipa_devirt): New function. (pass_data_ipa_devirt): New static var. (pass_ipa_devirt): Likewise. (make_pass_ipa_devirt): New function. * opts.c (default_options): Add OPT_fdevirtualize_speculatively. (common_handle_option): Disable devirtualization when value range profiling is available. * passes.def (pass_ipa_devirt): Add. * timever.def (TV_IPA_DEVIRT): New timevar. * tree-pass.h (make_pass_ipa_devirt): git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202145 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/opts.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gcc/opts.c') diff --git a/gcc/opts.c b/gcc/opts.c index 133fe0f717d..6b6652d89ca 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -479,6 +479,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_2_PLUS, OPT_ftree_switch_conversion, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fipa_cp, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fdevirtualize, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_fdevirtualize_speculatively, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fipa_sra, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_falign_loops, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_falign_jumps, NULL, 1 }, @@ -1665,6 +1666,11 @@ common_handle_option (struct gcc_options *opts, opts->x_flag_vect_cost_model = value; if (!opts_set->x_flag_tree_loop_distribute_patterns) opts->x_flag_tree_loop_distribute_patterns = value; + /* Indirect call profiling should do all useful transformations + speculative devirutalization does. */ + if (!opts_set->x_flag_devirtualize_speculatively + && opts->x_flag_value_profile_transformations) + opts->x_flag_devirtualize_speculatively = false; break; case OPT_fprofile_generate_: -- cgit v1.2.1