On 05/11/15 11:16, Tom de Vries wrote:
Hi,

now that we have committed -foffload-alias in gomp-4_0-branch (
https://gcc.gnu.org/ml/gcc-patches/2015-11/msg00214.html ), we no longer
need the kernels region to be a part of the original function when doing
alias analysis.

So, we no longer have the need to postpone splitting off the kernels
region into a seperate function until after alias analysis, but we can
do this at the same time as when we expand the parallel region.

The following patch series implements that:

      1    Move expansion of kernels region back to first omp-expand
      2    Update gate_oacc_kernels to handle oacc function
      3    Revert "Add skip_stmt parm to pass_dominator::get_sese ()"
      4    Revert "Add pass_dominator::sese_mode_p ()"
      5    Handle oacc function in parloops
      6    Update goacc kernels C testcases
      7    Update goacc kernels Fortran testcases
      8    Release_defs in expand_omp_atomic_fetch_op
      9    Remove BUILT_IN_GOACC_KERNELS_INTERNAL

[ The patch series is broken up into logical bits, but intended as
single commit. Various things in kernels support will be broken in
intermediate stages. ]

Committed to gomp-4_0-branch.

I'll post the patches in reply to this message.


We were using the skip_stmt functionality in pass_dominator to skip over a statement '.omp_data_i = &.omp_data_arr' in the kernels region. That statement is removed during function split-off, so we no longer encounter that statement in the kernels pass group.

This patch reverts the stip_stmt functionality.

Thanks,
- Tom

Revert "Add skip_stmt parm to pass_dominator::get_sese ()"

2015-11-04  Tom de Vries  <t...@codesourcery.com>

	Revert:
	2015-10-12  Tom de Vries  <t...@codesourcery.com>

	* tree-ssa-dom.c (dom_opt_dom_walker::set_skip_stmt): New function.
	(dom_opt_dom_walker::m_skip_stmt): New private var.
	(pass_dominator::get_sese): Add skip_stmt parameters.
	(pass_dominator::execute): Call set_skip_stmt with statement to skip for
	sese.
	(dom_opt_dom_walker::before_dom_children): Handle m_skip_stmt.
---
 gcc/tree-ssa-dom.c | 27 +++++----------------------
 1 file changed, 5 insertions(+), 22 deletions(-)

diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 6688a79..e1cf38b 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -505,7 +505,6 @@ public:
 
   virtual void before_dom_children (basic_block);
   virtual void after_dom_children (basic_block);
-  void set_skip_stmt (gimple *skip_stmt) { m_skip_stmt = skip_stmt; }
 
 private:
   void thread_across_edge (edge);
@@ -516,7 +515,6 @@ private:
 
   gcond *m_dummy_cond;
   bool m_jump_threading_p;
-  gimple *m_skip_stmt;
 };
 
 /* Jump threading, redundancy elimination and const/copy propagation.
@@ -544,11 +542,9 @@ class dominator_base : public gimple_opt_pass
   virtual bool sese_mode_p (void) { return false; }
 
   /* In sese mode, return true if there's another sese to visit.  Return the
-     sese to visit in SESE_ENTRY and SESE_EXIT.  If a stmt in the sese should
-     not be optimized, return it in SKIP_STMT.  */
+     sese to visit in SESE_ENTRY and SESE_EXIT.  */
   virtual bool get_sese (basic_block *sese_entry ATTRIBUTE_UNUSED,
-			 basic_block *sese_exit ATTRIBUTE_UNUSED,
-			 gimple **skip_stmt ATTRIBUTE_UNUSED)
+			 basic_block *sese_exit ATTRIBUTE_UNUSED)
     { gcc_unreachable (); }
 }; // class dominator_base
 
@@ -640,11 +636,8 @@ dominator_base::execute (function *fun)
   else
     {
       basic_block sese_entry, sese_exit;
-      gimple *skip_stmt = NULL;
-      while (get_sese (&sese_entry, &sese_exit, &skip_stmt))
+      while (get_sese (&sese_entry, &sese_exit))
 	{
-	  walker.set_skip_stmt (skip_stmt);
-
 	  threadedge_initialize_values ();
 	  avail_exprs_stack->push_marker ();
 	  const_and_copies->push_marker ();
@@ -797,8 +790,7 @@ public:
 protected:
   /* dominator_base methods: */
   virtual bool sese_mode_p (void) { return true; }
-  virtual bool get_sese (basic_block *sese_entry, basic_block *sese_exit,
-			 gimple **skip_stmt)
+  virtual bool get_sese (basic_block *sese_entry, basic_block *sese_exit)
   {
     if (m_regions == NULL)
       {
@@ -821,10 +813,6 @@ protected:
     *sese_entry = BASIC_BLOCK_FOR_FN (cfun, index);
     *sese_exit = get_oacc_kernels_region_exit (*sese_entry);
 
-    tree omp_data_i = get_omp_data_i (single_pred (*sese_entry));
-    if (omp_data_i != NULL_TREE)
-      *skip_stmt = SSA_NAME_DEF_STMT (omp_data_i);
-
     return true;
   }
 
@@ -1446,12 +1434,7 @@ dom_opt_dom_walker::before_dom_children (basic_block bb)
   m_avail_exprs_stack->pop_to_marker ();
 
   for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
-    {
-      if (gsi_stmt (gsi) == m_skip_stmt)
-	continue;
-
-      optimize_stmt (bb, gsi, m_const_and_copies, m_avail_exprs_stack);
-    }
+    optimize_stmt (bb, gsi, m_const_and_copies, m_avail_exprs_stack);
 
   /* Now prepare to process dominated blocks.  */
   if (m_jump_threading_p)
-- 
1.9.1

Reply via email to