aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2014-06-18 08:33:44 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2014-06-18 08:33:44 +0000
commit68f6df73324a1389bce336d55ae94aa58f519997 (patch)
treecea22e859af7a194868852aa25abe1653a1d9ea2
parent419d45db8e25741704b8ccd06699e4d4cfcfbc4e (diff)
downloadgcc-68f6df73324a1389bce336d55ae94aa58f519997.zip
gcc-68f6df73324a1389bce336d55ae94aa58f519997.tar.gz
gcc-68f6df73324a1389bce336d55ae94aa58f519997.tar.bz2
common.opt (fssa-phiopt): New option.
2014-06-18 Richard Biener <rguenther@suse.de> * common.opt (fssa-phiopt): New option. * opts.c (default_options_table): Enable -fssa-phiopt with -O1+ but not with -Og. * tree-ssa-phiopt.c (pass_phiopt): Add gate method. * doc/invoke.texi (-fssa-phiopt): Document. From-SVN: r211772
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/common.opt4
-rw-r--r--gcc/doc/invoke.texi8
-rw-r--r--gcc/opts.c1
-rw-r--r--gcc/tree-ssa-phiopt.c1
5 files changed, 21 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 98042bb..39fa9c2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2014-06-18 Richard Biener <rguenther@suse.de>
+
+ * common.opt (fssa-phiopt): New option.
+ * opts.c (default_options_table): Enable -fssa-phiopt with -O1+
+ but not with -Og.
+ * tree-ssa-phiopt.c (pass_phiopt): Add gate method.
+ * doc/invoke.texi (-fssa-phiopt): Document.
+
2014-06-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* genattrtab.c (n_bypassed): New variable.
diff --git a/gcc/common.opt b/gcc/common.opt
index 7f05092..de13e01 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1950,6 +1950,10 @@ fsplit-wide-types
Common Report Var(flag_split_wide_types) Optimization
Split wide types into independent registers
+fssa-phiopt
+Common Report Var(flag_ssa_phiopt) Optimization
+Optimize conditional patterns using SSA PHI nodes
+
fvariable-expansion-in-unroller
Common Report Var(flag_variable_expansion_in_unroller) Optimization
Apply variable expansion when loops are unrolled
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 9a34f1c..f7a54fa 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -412,7 +412,7 @@ Objective-C and Objective-C++ Dialects}.
-fselective-scheduling -fselective-scheduling2 @gol
-fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
-fshrink-wrap -fsignaling-nans -fsingle-precision-constant @gol
--fsplit-ivs-in-unroller -fsplit-wide-types -fstack-protector @gol
+-fsplit-ivs-in-unroller -fsplit-wide-types -fssa-phiopt -fstack-protector @gol
-fstack-protector-all -fstack-protector-strong -fstrict-aliasing @gol
-fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
-ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
@@ -6907,6 +6907,7 @@ compilation time.
-ftree-bit-ccp @gol
-ftree-builtin-call-dce @gol
-ftree-ccp @gol
+-fssa-phiopt @gol
-ftree-ch @gol
-ftree-copyrename @gol
-ftree-dce @gol
@@ -7892,6 +7893,11 @@ Perform sparse conditional constant propagation (CCP) on trees. This
pass only operates on local scalar variables and is enabled by default
at @option{-O} and higher.
+@item -fssa-phiopt
+@opindex fssa-phiopt
+Perform pattern matching on SSA PHI nodes to optimize conditional
+code. This pass is enabled by default at @option{-O} and higher.
+
@item -ftree-switch-conversion
Perform conversion of simple initializations in a switch to
initializations from a scalar array. This flag is enabled by default
diff --git a/gcc/opts.c b/gcc/opts.c
index 2b1280a..324d545 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -457,6 +457,7 @@ static const struct default_options default_options_table[] =
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fbranch_count_reg, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fmove_loop_invariants, NULL, 1 },
{ OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_ftree_pta, NULL, 1 },
+ { OPT_LEVELS_1_PLUS_NOT_DEBUG, OPT_fssa_phiopt, NULL, 1 },
/* -O2 optimizations. */
{ OPT_LEVELS_2_PLUS, OPT_finline_small_functions, NULL, 1 },
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 95844f4..5400299 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -2332,6 +2332,7 @@ public:
/* opt_pass methods: */
opt_pass * clone () { return new pass_phiopt (m_ctxt); }
+ virtual bool gate (function *) { return flag_ssa_phiopt; }
virtual unsigned int execute (function *)
{
return tree_ssa_phiopt_worker (false, gate_hoist_loads ());