public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [gomp4] remove IFN_GOACC_DIM handling from device_lower
@ 2015-11-09 17:40 Nathan Sidwell
  0 siblings, 0 replies; only message in thread
From: Nathan Sidwell @ 2015-11-09 17:40 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 83 bytes --]

I've committed this to gomp4, the relevant handling is in gimple-fold now.

nathan

[-- Attachment #2: gomp4-ifn.patch --]
[-- Type: text/x-patch, Size: 1796 bytes --]

2015-11-09  Nathan Sidwell  <nathan@codesourcery.com>

	* omp-low.c (oacc_xform_dim): Delete.
	(execute_oacc_device_lower): Remove IFN_GOACC_DIM_POS,
	IFN_GOACC_DIM_SIZE handling.

Index: omp-low.c
===================================================================
--- omp-low.c	(revision 230022)
+++ omp-low.c	(working copy)
@@ -18835,38 +18835,6 @@ omp_finish_file (void)
     }
 }
 
-/* Transform oacc_dim_size and oacc_dim_pos internal function calls to
-   constants, where possible.  */
-
-static bool
-oacc_xform_dim (gcall *call, const int dims[], bool is_pos)
-{
-  tree arg = gimple_call_arg (call, 0);
-  unsigned axis = (unsigned)TREE_INT_CST_LOW (arg);
-  int size = dims[axis];
-
-  if (!size)
-    /* Dimension size is dynamic.  */
-    return false;
-  
-  if (is_pos)
-    {
-      if (size != 1)
-	/* Size is more than 1, so POS might be non-zero.  */
-	return false;
-      size = 0;
-    }
-
-  /* Replace the internal call with a constant.  */
-  tree lhs = gimple_call_lhs (call);
-  gimple *g = gimple_build_assign
-    (lhs, build_int_cst (integer_type_node, size));
-
-  gimple_stmt_iterator gsi = gsi_for_stmt (call);
-  gsi_replace (&gsi, g, false);
-  return true;
-}
-
 /* Find the number of threads (POS = false), or thread number (POS =
    true) for an OpenACC region partitioned as MASK.  Setup code
    required for the calculation is added to SEQ.  */
@@ -19877,15 +19845,6 @@ execute_oacc_device_lower ()
 	  {
 	  default: break;
 
-	  case IFN_GOACC_DIM_POS:
-	  case IFN_GOACC_DIM_SIZE:
-	    if (gimple_call_lhs (call) == NULL_TREE)
-	      remove = true;
-	    else if (oacc_xform_dim (call, dims,
-				     ifn_code == IFN_GOACC_DIM_POS))
-	      rescan = true;
-	    break;
-
 	  case IFN_GOACC_LOOP:
 	    oacc_xform_loop (call);
 	    rescan = true;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-11-09 17:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-09 17:40 [gomp4] remove IFN_GOACC_DIM handling from device_lower Nathan Sidwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).