diff options
author | Segher Boessenkool <segher@kernel.crashing.org> | 2015-10-01 08:38:24 +0200 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2015-10-01 08:38:24 +0200 |
commit | 59faab7cc48681d8b2c995bdc466e1f3262839fa (patch) | |
tree | a8576e110feff8492232a921cc8f8c525d14265c /gcc/opts.c | |
parent | 248c16c49ac74146a3b21f7536ede9b0f4378493 (diff) | |
download | gcc-59faab7cc48681d8b2c995bdc466e1f3262839fa.zip gcc-59faab7cc48681d8b2c995bdc466e1f3262839fa.tar.gz gcc-59faab7cc48681d8b2c995bdc466e1f3262839fa.tar.bz2 |
bb-reorder: Add -freorder-blocks-algorithm= and wire it up
This adds an -freorder-blocks-algorithm=[simple|stc] flag, with "simple"
as default. For -O2 and up (except -Os) it is switched to "stc" instead.
Targets that never want STC can override this. This changes -freorder-blocks
to be on at -O1 and up (was -O2 and up).
In effect, the changes are for -O1 (which now gets "simple" instead of
nothing), -Os (which now gets "simple" instead of "stc", since STC results
in much bigger code), and for targets that wish to never use STC (not in
this patch though).
2015-09-23 Segher Boessenkool <segher@kernel.crashing.org>
* bb-reorder.c (reorder_basic_blocks): Use the algorithm selected
with flag_reorder_blocks_algorithm.
* common.opt (freorder-blocks-algorithm=): New flag.
(reorder_blocks_algorithm): New enum.
* flag-types.h (reorder_blocks_algorithm): New enum.
* opts.c (default_options_table): Use -freorder-blocks at -O1 and up,
and -freorder-blocks-algorithm=stc at -O2 and up (not at -Os).
From-SVN: r228318
Diffstat (limited to 'gcc/opts.c')
-rw-r--r-- | gcc/opts.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -441,6 +441,7 @@ static const struct default_options default_options_table[] = { OPT_LEVELS_1_PLUS, OPT_fipa_reference, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_fipa_profile, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_fmerge_constants, NULL, 1 }, + { OPT_LEVELS_1_PLUS, OPT_freorder_blocks, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_fshrink_wrap, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_fsplit_wide_types, NULL, 1 }, { OPT_LEVELS_1_PLUS, OPT_ftree_ccp, NULL, 1 }, @@ -483,7 +484,8 @@ static const struct default_options default_options_table[] = #endif { OPT_LEVELS_2_PLUS, OPT_fstrict_aliasing, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_fstrict_overflow, NULL, 1 }, - { OPT_LEVELS_2_PLUS, OPT_freorder_blocks, NULL, 1 }, + { OPT_LEVELS_2_PLUS_SPEED_ONLY, OPT_freorder_blocks_algorithm_, NULL, + REORDER_BLOCKS_ALGORITHM_STC }, { OPT_LEVELS_2_PLUS, OPT_freorder_functions, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_ftree_vrp, NULL, 1 }, { OPT_LEVELS_2_PLUS, OPT_ftree_builtin_call_dce, NULL, 1 }, |