From 3c99176a7f968bdb8b7a3225265246f643551c80 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 17 Feb 2015 21:25:56 +0000 Subject: Add -fipa-cp-alignment This patch adds -fipa-cp-alignment to provide a way to enable/disable alignment discovery and propagation in IPA-CP. gcc/ * common.opt (fipa-cp-alignment): New. * ipa-cp.c (ipcp_store_alignment_results): Check flag_ipa_cp_alignment. * opts.c (default_options_table): Enable -fipa-cp-alignment for -O2. (enable_fdo_optimizations): Set x_flag_ipa_cp_alignment. * doc/invoke.texi: Document -fipa-cp-alignment. gcc/testsuite/ * gcc.dg/ipa/propalign-3.c: New test. From-SVN: r220773 --- gcc/opts.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/opts.c') diff --git a/gcc/opts.c b/gcc/opts.c index 4a1ed0e..39c190d 100644 --- a/gcc/opts.c +++ b/gcc/opts.c @@ -493,6 +493,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_2_PLUS, OPT_ftree_pre, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_ftree_switch_conversion, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fipa_cp, NULL, 1 }, + { OPT_LEVELS_2_PLUS, OPT_fipa_cp_alignment, 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 }, @@ -1330,6 +1331,9 @@ enable_fdo_optimizations (struct gcc_options *opts, if (!opts_set->x_flag_ipa_cp_clone && value && opts->x_flag_ipa_cp) opts->x_flag_ipa_cp_clone = value; + if (!opts_set->x_flag_ipa_cp_alignment + && value && opts->x_flag_ipa_cp) + opts->x_flag_ipa_cp_alignment = value; if (!opts_set->x_flag_predictive_commoning) opts->x_flag_predictive_commoning = value; if (!opts_set->x_flag_unswitch_loops) -- cgit v1.1