summaryrefslogtreecommitdiff
path: root/gcc/gimple-ssa-strength-reduction.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 12:56:47 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-22 12:56:47 +0000
commit030087e31b1253fb9ed6835a82e93a61ccc02493 (patch)
treee2bc6c7177a42d1b832555b60d0a854bcb834bd0 /gcc/gimple-ssa-strength-reduction.c
parentb4f314ea97f04620d290f3ae25d831f46692864f (diff)
parentac875fa40bf5429aff0612943d8c5705c4e11bb5 (diff)
downloadgcc-030087e31b1253fb9ed6835a82e93a61ccc02493.tar.gz
Merge from trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209623 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-ssa-strength-reduction.c')
-rw-r--r--gcc/gimple-ssa-strength-reduction.c71
1 files changed, 32 insertions, 39 deletions
diff --git a/gcc/gimple-ssa-strength-reduction.c b/gcc/gimple-ssa-strength-reduction.c
index 5e35b12d3c8..cf252d4269d 100644
--- a/gcc/gimple-ssa-strength-reduction.c
+++ b/gcc/gimple-ssa-strength-reduction.c
@@ -3585,8 +3585,37 @@ analyze_candidates_and_replace (void)
}
}
-static unsigned
-execute_strength_reduction (void)
+namespace {
+
+const pass_data pass_data_strength_reduction =
+{
+ GIMPLE_PASS, /* type */
+ "slsr", /* name */
+ OPTGROUP_NONE, /* optinfo_flags */
+ true, /* has_execute */
+ TV_GIMPLE_SLSR, /* tv_id */
+ ( PROP_cfg | PROP_ssa ), /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_verify_ssa, /* todo_flags_finish */
+};
+
+class pass_strength_reduction : public gimple_opt_pass
+{
+public:
+ pass_strength_reduction (gcc::context *ctxt)
+ : gimple_opt_pass (pass_data_strength_reduction, ctxt)
+ {}
+
+ /* opt_pass methods: */
+ virtual bool gate (function *) { return flag_tree_slsr; }
+ virtual unsigned int execute (function *);
+
+}; // class pass_strength_reduction
+
+unsigned
+pass_strength_reduction::execute (function *fun)
{
/* Create the obstack where candidates will reside. */
gcc_obstack_init (&cand_obstack);
@@ -3613,7 +3642,7 @@ execute_strength_reduction (void)
/* Walk the CFG in predominator order looking for strength reduction
candidates. */
find_candidates_dom_walker (CDI_DOMINATORS)
- .walk (cfun->cfg->x_entry_block_ptr);
+ .walk (fun->cfg->x_entry_block_ptr);
if (dump_file && (dump_flags & TDF_DETAILS))
{
@@ -3637,42 +3666,6 @@ execute_strength_reduction (void)
return 0;
}
-static bool
-gate_strength_reduction (void)
-{
- return flag_tree_slsr;
-}
-
-namespace {
-
-const pass_data pass_data_strength_reduction =
-{
- GIMPLE_PASS, /* type */
- "slsr", /* name */
- OPTGROUP_NONE, /* optinfo_flags */
- true, /* has_gate */
- true, /* has_execute */
- TV_GIMPLE_SLSR, /* tv_id */
- ( PROP_cfg | PROP_ssa ), /* properties_required */
- 0, /* properties_provided */
- 0, /* properties_destroyed */
- 0, /* todo_flags_start */
- TODO_verify_ssa, /* todo_flags_finish */
-};
-
-class pass_strength_reduction : public gimple_opt_pass
-{
-public:
- pass_strength_reduction (gcc::context *ctxt)
- : gimple_opt_pass (pass_data_strength_reduction, ctxt)
- {}
-
- /* opt_pass methods: */
- bool gate () { return gate_strength_reduction (); }
- unsigned int execute () { return execute_strength_reduction (); }
-
-}; // class pass_strength_reduction
-
} // anon namespace
gimple_opt_pass *