]> git.ipfire.org Git - thirdparty/gcc.git/commit
bb-reorder: Add -freorder-blocks-algorithm= and wire it up
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Oct 2015 06:38:24 +0000 (06:38 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 1 Oct 2015 06:38:24 +0000 (06:38 +0000)
commite57ef194b2cbbc8f178bdb6259e3bf3d2d4512e3
treea8576e110feff8492232a921cc8f8c525d14265c
parent2f619490792ebf0f15f9342b01a38ed66ff9b530
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).

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228318 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/bb-reorder.c
gcc/common.opt
gcc/flag-types.h
gcc/opts.c