aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dom.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2015-11-16 12:40:24 +0000
committerTom de Vries <vries@gcc.gnu.org>2015-11-16 12:40:24 +0000
commit5ce8d99a1b45692a14b4a8aaf5b481738bf95172 (patch)
treefa576c46796bf106c419ef642f60d7c8277203e6 /gcc/tree-ssa-dom.c
parent2162bfe15e549b125b8183fc5f3d6e1d05ef5c98 (diff)
downloadgcc-5ce8d99a1b45692a14b4a8aaf5b481738bf95172.zip
gcc-5ce8d99a1b45692a14b4a8aaf5b481738bf95172.tar.gz
gcc-5ce8d99a1b45692a14b4a8aaf5b481738bf95172.tar.bz2
Remove first_pass_instance from pass_dominator
2015-11-16 Tom de Vries <tom@codesourcery.com> * passes.def: Add arg to pass_dominator pass instantiation. * tree-pass.h (first_pass_instance): Remove pass_dominator-related bit of comment. * tree-ssa-dom.c (pass_dominator::pass_dominator): Initialize may_peel_loop_headers_p. (pass_dominator::set_pass_param): New member function. Set may_peel_loop_headers_p. (pass_dominator::may_peel_loop_headers_p): New private member. (pass_dominator::execute): Use may_peel_loop_headers_p instead of first_pass_instance. From-SVN: r230417
Diffstat (limited to 'gcc/tree-ssa-dom.c')
-rw-r--r--gcc/tree-ssa-dom.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 5cb2644..aeb726c 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -536,14 +536,26 @@ class pass_dominator : public gimple_opt_pass
{
public:
pass_dominator (gcc::context *ctxt)
- : gimple_opt_pass (pass_data_dominator, ctxt)
+ : gimple_opt_pass (pass_data_dominator, ctxt),
+ may_peel_loop_headers_p (false)
{}
/* opt_pass methods: */
opt_pass * clone () { return new pass_dominator (m_ctxt); }
+ void set_pass_param (unsigned int n, bool param)
+ {
+ gcc_assert (n == 0);
+ may_peel_loop_headers_p = param;
+ }
virtual bool gate (function *) { return flag_tree_dom != 0; }
virtual unsigned int execute (function *);
+ private:
+ /* This flag is used to prevent loops from being peeled repeatedly in jump
+ threading; it will be removed once we preserve loop structures throughout
+ the compilation -- we will be able to mark the affected loops directly in
+ jump threading, and avoid peeling them next time. */
+ bool may_peel_loop_headers_p;
}; // class pass_dominator
unsigned int
@@ -619,7 +631,7 @@ pass_dominator::execute (function *fun)
free_all_edge_infos ();
/* Thread jumps, creating duplicate blocks as needed. */
- cfg_altered |= thread_through_all_blocks (first_pass_instance);
+ cfg_altered |= thread_through_all_blocks (may_peel_loop_headers_p);
if (cfg_altered)
free_dominance_info (CDI_DOMINATORS);