aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-ssa-loop.c')
-rw-r--r--gcc/tree-ssa-loop.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index b2a7d18..7771a0d 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -436,8 +436,7 @@ const pass_data pass_data_scev_cprop =
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
- ( TODO_cleanup_cfg
- | TODO_update_ssa_only_virtuals ), /* todo_flags_finish */
+ 0, /* todo_flags_finish */
};
class pass_scev_cprop : public gimple_opt_pass
@@ -449,10 +448,24 @@ public:
/* opt_pass methods: */
virtual bool gate (function *) { return flag_tree_scev_cprop; }
- virtual unsigned int execute (function *) { return scev_const_prop (); }
+ virtual unsigned int execute (function *);
}; // class pass_scev_cprop
+unsigned
+pass_scev_cprop::execute (function *)
+{
+ struct loop *loop;
+ bool any = false;
+
+ /* Perform final value replacement in loops, in case the replacement
+ expressions are cheap. */
+ FOR_EACH_LOOP (loop, LI_FROM_INNERMOST)
+ any |= final_value_replacement_loop (loop);
+
+ return any ? TODO_cleanup_cfg | TODO_update_ssa_only_virtuals : 0;
+}
+
} // anon namespace
gimple_opt_pass *