aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-split-paths.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2015-12-17 16:33:44 -0700
committerJeff Law <law@gcc.gnu.org>2015-12-17 16:33:44 -0700
commit72ca20f9cb4755c8f1eacedcf229a5d6827039d3 (patch)
tree56a61439f85b853a276516f7416b8845a06d3886 /gcc/gimple-ssa-split-paths.c
parentaa3987819a5ab392bcb125efe84008e75f99bbfc (diff)
downloadgcc-72ca20f9cb4755c8f1eacedcf229a5d6827039d3.zip
gcc-72ca20f9cb4755c8f1eacedcf229a5d6827039d3.tar.gz
gcc-72ca20f9cb4755c8f1eacedcf229a5d6827039d3.tar.bz2
[PATCH] Limit path splitting to loops we optimize for speed
* doc/invoke.texi (-O2 options): Remove -fsplit-paths. (-O3 options): Add -fsplit-paths. * gimple-ssa-split-paths.c: Include predict.h (split_paths): Only split paths in a loop that should be optimized for speed. * opts.c (default_options_table): Move -fsplit-paths from -O2 to -O3. * gcc.dg/tree-ssa/split-path-1.c: Explicitly ask for path splitting optimizations. From-SVN: r231790
Diffstat (limited to 'gcc/gimple-ssa-split-paths.c')
-rw-r--r--gcc/gimple-ssa-split-paths.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/gimple-ssa-split-paths.c b/gcc/gimple-ssa-split-paths.c
index 602e916..540fdf3 100644
--- a/gcc/gimple-ssa-split-paths.c
+++ b/gcc/gimple-ssa-split-paths.c
@@ -29,6 +29,7 @@ along with GCC; see the file COPYING3. If not see
#include "cfgloop.h"
#include "gimple-iterator.h"
#include "tracer.h"
+#include "predict.h"
/* Given LATCH, the latch block in a loop, see if the shape of the
path reaching LATCH is suitable for being split by duplication.
@@ -180,9 +181,14 @@ split_paths ()
FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
{
+ /* Only split paths if we are optimizing this loop for speed. */
+ if (!optimize_loop_for_speed_p (loop))
+ continue;
+
/* See if there is a block that we can duplicate to split the
path to the loop latch. */
- basic_block bb = find_block_to_duplicate_for_splitting_paths (loop->latch);
+ basic_block bb
+ = find_block_to_duplicate_for_splitting_paths (loop->latch);
/* BB is the merge point for an IF-THEN-ELSE we want to transform.