diff mbox

[gomp4] Avoiding predication for certain blocks

Message ID 87k2k87gsd.fsf@kepler.schwinge.homeip.net
State New
Headers show

Commit Message

Thomas Schwinge April 8, 2016, 6:31 a.m. UTC
Hi!

I cleaned up this remnant from an earlier OpenACC execution model
implementation:

On Fri, 29 May 2015 18:23:21 +0200, Bernd Schmidt <bernds@codesourcery.com> wrote:
> When predicating the code for OpenACC, we should avoid the entry block 
> in an offloaded region, which contains setup code that should be run in 
> every thread. The following patch adds a new marker statement that is 
> used to identify this block. Currently, predication doesn't happen 
> anyway due to an oversight in the algorithm, but I'll be fixing that in 
> a followup patch.
> 
> Committed on gomp-4_0-branch.

> --- gcc/gimple.def	(revision 223867)
> +++ gcc/gimple.def	(working copy)

> +/* GIMPLE_OMP_ENTRY_END marks the end of the unpredicated entry block
> +   into an offloaded region.  */
> +DEFGSCODE(GIMPLE_OMP_ENTRY_END, "gimple_omp_entry_end", GSS_BASE)

Committed to gomp-4_0-branch in r234822:

commit af76e7c5279c0eb87b6b91b42d2568679ad6bbb9
Author: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Fri Apr 8 06:30:08 2016 +0000

    Remove GIMPLE_OMP_ENTRY_END
    
    	gcc/
    	* gimple.def: Remove GIMPLE_OMP_ENTRY_END.  Remove all uses.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gomp-4_0-branch@234822 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog.gomp        |  4 ++++
 gcc/gimple-low.c          |  1 -
 gcc/gimple-pretty-print.c |  4 ----
 gcc/gimple.c              |  9 ---------
 gcc/gimple.def            |  4 ----
 gcc/gimple.h              |  2 --
 gcc/omp-low.c             | 15 +--------------
 7 files changed, 5 insertions(+), 34 deletions(-)



Grüße
 Thomas
diff mbox

Patch

diff --git gcc/ChangeLog.gomp gcc/ChangeLog.gomp
index 3c9eed6..bffc261 100644
--- gcc/ChangeLog.gomp
+++ gcc/ChangeLog.gomp
@@ -1,3 +1,7 @@ 
+2016-04-08  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* gimple.def: Remove GIMPLE_OMP_ENTRY_END.  Remove all uses.
+
 2016-03-11  Cesar Philippidis  <cesar@codesourcery.com>
 
 	* config/nvptx/nvptx.c (nvptx_gen_shuffle): Add support for QImode
diff --git gcc/gimple-low.c gcc/gimple-low.c
index 13c0165..eb90d48 100644
--- gcc/gimple-low.c
+++ gcc/gimple-low.c
@@ -313,7 +313,6 @@  lower_stmt (gimple_stmt_iterator *gsi, struct lower_data *data)
     case GIMPLE_OMP_ATOMIC_LOAD:
     case GIMPLE_OMP_ATOMIC_STORE:
     case GIMPLE_OMP_CONTINUE:
-    case GIMPLE_OMP_ENTRY_END:
       break;
 
     case GIMPLE_CALL:
diff --git gcc/gimple-pretty-print.c gcc/gimple-pretty-print.c
index 50d61fa..e27214f 100644
--- gcc/gimple-pretty-print.c
+++ gcc/gimple-pretty-print.c
@@ -2304,10 +2304,6 @@  pp_gimple_stmt_1 (pretty_printer *buffer, gimple *gs, int spc, int flags)
       pp_string (buffer, "GIMPLE_SECTIONS_SWITCH");
       break;
 
-    case GIMPLE_OMP_ENTRY_END:
-      pp_string (buffer, "GIMPLE_OMP_ENTRY_END");
-      break;
-
     case GIMPLE_OMP_MASTER:
     case GIMPLE_OMP_TASKGROUP:
     case GIMPLE_OMP_SECTION:
diff --git gcc/gimple.c gcc/gimple.c
index ee11112..b0e19d5 100644
--- gcc/gimple.c
+++ gcc/gimple.c
@@ -828,15 +828,6 @@  gimple_build_debug_source_bind_stat (tree var, tree value,
 }
 
 
-/* Build a GIMPLE_OMP_ENTRY_END statement.  */
-
-gimple *
-gimple_build_omp_entry_end (void)
-{
-  return gimple_alloc (GIMPLE_OMP_ENTRY_END, 0);
-}
-
-
 /* Build a GIMPLE_OMP_CRITICAL statement.
 
    BODY is the sequence of statements for which only one thread can execute.
diff --git gcc/gimple.def gcc/gimple.def
index faf0166..2ff22b8 100644
--- gcc/gimple.def
+++ gcc/gimple.def
@@ -227,10 +227,6 @@  DEFGSCODE(GIMPLE_OMP_ATOMIC_STORE, "gimple_omp_atomic_store",
    iteration in partially lowered OpenMP code.  */
 DEFGSCODE(GIMPLE_OMP_CONTINUE, "gimple_omp_continue", GSS_OMP_CONTINUE)
 
-/* GIMPLE_OMP_ENTRY_END marks the end of the unpredicated entry block
-   into an offloaded region.  */
-DEFGSCODE(GIMPLE_OMP_ENTRY_END, "gimple_omp_entry_end", GSS_BASE)
-
 /* GIMPLE_OMP_CRITICAL <NAME, BODY> represents
 
    #pragma omp critical [name]
diff --git gcc/gimple.h gcc/gimple.h
index 22d2a07..6d15dab 100644
--- gcc/gimple.h
+++ gcc/gimple.h
@@ -1451,7 +1451,6 @@  gdebug *gimple_build_debug_bind_stat (tree, tree, gimple * MEM_STAT_DECL);
 gdebug *gimple_build_debug_source_bind_stat (tree, tree, gimple * MEM_STAT_DECL);
 #define gimple_build_debug_source_bind(var,val,stmt)			\
   gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
-gimple *gimple_build_omp_entry_end (void);
 gomp_critical *gimple_build_omp_critical (gimple_seq, tree, tree);
 gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
 gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
@@ -6061,7 +6060,6 @@  gimple_return_set_retbnd (gimple *gs, tree retval)
     case GIMPLE_OMP_ORDERED:			\
     case GIMPLE_OMP_CRITICAL:			\
     case GIMPLE_OMP_RETURN:			\
-    case GIMPLE_OMP_ENTRY_END:			\
     case GIMPLE_OMP_ATOMIC_LOAD:		\
     case GIMPLE_OMP_ATOMIC_STORE:		\
     case GIMPLE_OMP_CONTINUE:			\
diff --git gcc/omp-low.c gcc/omp-low.c
index 299447e..9cb6425 100644
--- gcc/omp-low.c
+++ gcc/omp-low.c
@@ -13159,14 +13159,6 @@  expand_omp_target (struct omp_region *region)
   if (gimple_omp_target_kind (entry_stmt) == GF_OMP_TARGET_KIND_OACC_KERNELS)
     mark_loops_in_oacc_kernels_region (region->entry, region->exit);
 
-  basic_block entry_succ_bb = single_succ (entry_bb);
-  if (offloaded)
-    {
-      gsi = gsi_last_bb (entry_succ_bb);
-      if (gimple_code (gsi_stmt (gsi)) == GIMPLE_OMP_ENTRY_END)
-	gsi_remove (&gsi, true);
-    }
-
   if (offloaded)
     {
       unsigned srcidx, dstidx, num;
@@ -13187,6 +13179,7 @@  expand_omp_target (struct omp_region *region)
       tree data_arg = gimple_omp_target_data_arg (entry_stmt);
       if (data_arg)
 	{
+	  basic_block entry_succ_bb = single_succ (entry_bb);
 	  gimple_stmt_iterator gsi;
 	  tree arg;
 	  gimple *tgtcopy_stmt = NULL;
@@ -14063,8 +14056,6 @@  build_omp_regions_1 (basic_block bb, struct omp_region *parent,
 	  gcc_assert (parent);
 	  parent->cont = bb;
 	}
-      else if (code == GIMPLE_OMP_ENTRY_END)
-	gcc_assert (parent);
       else if (code == GIMPLE_OMP_SECTIONS_SWITCH)
 	{
 	  /* GIMPLE_OMP_SECTIONS_SWITCH is part of
@@ -16978,9 +16969,6 @@  lower_omp_target (gimple_stmt_iterator *gsi_p, omp_context *ctx)
 				 false, NULL, NULL, &fork_seq, &join_seq, ctx);
 	}
 
-      if (offloaded)
-	gimple_seq_add_stmt (&new_body, gimple_build_omp_entry_end ());
-
       gimple_seq_add_seq (&new_body, fork_seq);
       gimple_seq_add_seq (&new_body, tgt_body);
       gimple_seq_add_seq (&new_body, join_seq);
@@ -18501,7 +18489,6 @@  make_gimple_omp_edges (basic_block bb, struct omp_region **region,
       fallthru = false;
       break;
 
-    case GIMPLE_OMP_ENTRY_END:
     case GIMPLE_OMP_ATOMIC_LOAD:
     case GIMPLE_OMP_ATOMIC_STORE:
        fallthru = true;