public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add flag to control straight-line strength reduction
@ 2012-07-17 15:46 William J. Schmidt
  2012-07-18  7:59 ` Richard Guenther
  0 siblings, 1 reply; 11+ messages in thread
From: William J. Schmidt @ 2012-07-17 15:46 UTC (permalink / raw)
  To: gcc-patches; +Cc: bergner, rguenther

I overlooked adding a pass-control flag for strength reduction, added
here.  I named it -ftree-slsr for consistency with other -ftree- flags,
but could change it to -fgimple-slsr if you prefer that for a pass named
gimple-ssa-...

Bootstrapped and tested on powerpc-unknown-linux-gnu with no new
regressions.  Ok for trunk?

Thanks,
Bill


2012-07-17  Bill Schmidt  <wschmidt@linux.ibm.com>

	* opts.c (default_option): Make -ftree-slsr default at -O1 and above.
	* gimple-ssa-strength-reduction.c (gate_strength_reduction): Use
	flag_tree_slsr.
	* common.opt: Add -ftree-slsr with flag_tree_slsr.


Index: gcc/opts.c
===================================================================
--- gcc/opts.c	(revision 189574)
+++ gcc/opts.c	(working copy)
@@ -452,6 +452,7 @@ static const struct default_options default_option
     { OPT_LEVELS_1_PLUS, OPT_ftree_ch, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_fcombine_stack_adjustments, NULL, 1 },
     { OPT_LEVELS_1_PLUS, OPT_fcompare_elim, NULL, 1 },
+    { OPT_LEVELS_1_PLUS, OPT_ftree_slsr, NULL, 1 },
 
     /* -O2 optimizations.  */
     { OPT_LEVELS_2_PLUS, OPT_finline_small_functions, NULL, 1 },
Index: gcc/gimple-ssa-strength-reduction.c
===================================================================
--- gcc/gimple-ssa-strength-reduction.c	(revision 189574)
+++ gcc/gimple-ssa-strength-reduction.c	(working copy)
@@ -1501,7 +1501,7 @@ execute_strength_reduction (void)
 static bool
 gate_strength_reduction (void)
 {
-  return optimize > 0;
+  return flag_tree_slsr;
 }
 
 struct gimple_opt_pass pass_strength_reduction =
Index: gcc/common.opt
===================================================================
--- gcc/common.opt	(revision 189574)
+++ gcc/common.opt	(working copy)
@@ -2080,6 +2080,10 @@ ftree-sink
 Common Report Var(flag_tree_sink) Optimization
 Enable SSA code sinking on trees
 
+ftree-slsr
+Common Report Var(flag_tree_slsr) Optimization
+Perform straight-line strength reduction
+
 ftree-sra
 Common Report Var(flag_tree_sra) Optimization
 Perform scalar replacement of aggregates


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2012-07-18 14:36 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-17 15:46 [PATCH] Add flag to control straight-line strength reduction William J. Schmidt
2012-07-18  7:59 ` Richard Guenther
2012-07-18  8:11   ` Steven Bosscher
2012-07-18  9:01     ` Richard Guenther
2012-07-18 13:25       ` William J. Schmidt
2012-07-18 13:29         ` William J. Schmidt
2012-07-18 14:15         ` Steven Bosscher
2012-07-18 14:36           ` Richard Guenther
2012-07-18 14:00       ` William J. Schmidt
2012-07-18 14:35         ` Richard Guenther
2012-07-18  9:02     ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).