diff mbox

[gomp4,committed] Add dominator_base::may_peel_loop_headers_p

Message ID 563FC527.3020908@mentor.com
State New
Headers show

Commit Message

Tom de Vries Nov. 8, 2015, 9:56 p.m. UTC
Hi,

This patch eliminates the first_pass_instance test in 
dominator_base::execute, and introduces a virtual function 
dominator_base::may_peel_loop_headers_p that is tested instead.  This 
allows us to choose may_peel_loop_headers_p == false for 
pass_dominator_oacc_kernels.

Thanks,
- Tom
diff mbox

Patch

Add dominator_base::may_peel_loop_headers_p

2015-11-08  Tom de Vries  <tom@codesourcery.com>

	* tree-ssa-dom.c (dominator_base::may_peel_loop_headers_p)
	(pass_dominator::may_peel_loop_headers_p)
	(pass_dominator_oacc_kernels::may_peel_loop_headers_p):: New function.
	(dominator_base::execute): Use may_peel_loop_headers_p.
---
 gcc/tree-ssa-dom.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 10110d7..a2abb8e 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -529,6 +529,8 @@  class dominator_base : public gimple_opt_pass
 
   unsigned int execute (function *);
 
+ protected:
+  virtual bool may_peel_loop_headers_p (void) { return true; }
 }; // class dominator_base
 
 const pass_data pass_data_dominator =
@@ -554,6 +556,9 @@  public:
   /* opt_pass methods: */
   opt_pass * clone () { return new pass_dominator (m_ctxt); }
   virtual bool gate (function *) { return flag_tree_dom != 0; }
+
+ protected:
+  virtual bool may_peel_loop_headers_p (void) { return first_pass_instance; }
 }; // class pass_dominator
 
 unsigned int
@@ -629,7 +634,7 @@  dominator_base::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);
@@ -736,6 +741,9 @@  public:
 
  private:
   bitmap m_regions;
+
+ protected:
+  virtual bool may_peel_loop_headers_p (void) { return false; }
 }; // class pass_dominator_oacc_kernels
 
 } // anon namespace
-- 
1.9.1