From 68f6df73324a1389bce336d55ae94aa58f519997 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 18 Jun 2014 08:33:44 +0000 Subject: common.opt (fssa-phiopt): New option. 2014-06-18 Richard Biener * 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 --- gcc/ChangeLog | 8 ++++++++ gcc/common.opt | 4 ++++ gcc/doc/invoke.texi | 8 +++++++- gcc/opts.c | 1 + gcc/tree-ssa-phiopt.c | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) 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 + + * 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 * 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 ()); -- cgit v1.1