]> gcc.gnu.org Git - gcc.git/commitdiff
[PR libgomp/64625] Remove __OFFLOAD_TABLE__ variable/formal parameter.
authorThomas Schwinge <thomas@codesourcery.com>
Mon, 19 Jan 2015 12:03:35 +0000 (13:03 +0100)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Mon, 19 Jan 2015 12:03:35 +0000 (13:03 +0100)
gcc/
* omp-low.c (offload_symbol_decl): Remove variable.
(get_offload_symbol_decl): Remove function.
(expand_omp_target): For BUILT_IN_GOMP_TARGET,
BUILT_IN_GOMP_TARGET_DATA, BUILT_IN_GOMP_TARGET_UPDATE pass NULL
instead of &__OFFLOAD_TABLE__, for BUILT_IN_GOACC_DATA_START,
BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_PARALLEL,
BUILT_IN_GOACC_UPDATE don't pass it at all.
libgomp/
* libgomp_g.h (GOACC_data_start, GOACC_enter_exit_data)
(GOACC_parallel, GOACC_update): Remove const_void *offload_table
formal parameter.  Update all users.
* target.c (GOMP_target, GOMP_target_data, GOMP_target_update):
Document unused formal parameter.

From-SVN: r219836

gcc/ChangeLog
gcc/omp-low.c
libgomp/ChangeLog
libgomp/libgomp_g.h
libgomp/oacc-parallel.c
libgomp/target.c

index 6f3431b347971e6305cb19ec6d092445fba458f9..3ee35a6a4ca6c25372cfeeba830b0eafd5a85788 100644 (file)
@@ -1,3 +1,13 @@
+2015-01-19  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * omp-low.c (offload_symbol_decl): Remove variable.
+       (get_offload_symbol_decl): Remove function.
+       (expand_omp_target): For BUILT_IN_GOMP_TARGET,
+       BUILT_IN_GOMP_TARGET_DATA, BUILT_IN_GOMP_TARGET_UPDATE pass NULL
+       instead of &__OFFLOAD_TABLE__, for BUILT_IN_GOACC_DATA_START,
+       BUILT_IN_GOACC_ENTER_EXIT_DATA, BUILT_IN_GOACC_PARALLEL,
+       BUILT_IN_GOACC_UPDATE don't pass it at all.
+
 2015-01-19  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        * tree-sra.c (some_callers_have_mismatched_arguments_p): Allow thunk
index b7bf338b70288fa4ac9cb6df7f26252e6cf14ac8..15893109889b6ae6acffd241e13a9531f08944cf 100644 (file)
@@ -340,30 +340,6 @@ oacc_max_threads (omp_context *ctx)
 /* Holds offload tables with decls.  */
 vec<tree, va_gc> *offload_funcs, *offload_vars;
 
-/* Holds a decl for __OFFLOAD_TABLE__.  */
-static GTY(()) tree offload_symbol_decl;
-
-/* Get the __OFFLOAD_TABLE__ symbol.  */
-static tree
-get_offload_symbol_decl (void)
-{
-  if (!offload_symbol_decl)
-    {
-      tree decl = build_decl (UNKNOWN_LOCATION, VAR_DECL,
-                             get_identifier ("__OFFLOAD_TABLE__"),
-                             ptr_type_node);
-      TREE_ADDRESSABLE (decl) = 1;
-      TREE_PUBLIC (decl) = 1;
-      DECL_EXTERNAL (decl) = 1;
-      DECL_WEAK (decl) = 1;
-      DECL_ATTRIBUTES (decl)
-       = tree_cons (get_identifier ("weak"),
-                    NULL_TREE, DECL_ATTRIBUTES (decl));
-      offload_symbol_decl = decl;
-    }
-  return offload_symbol_decl;
-}
-
 /* Convenience function for calling scan_omp_1_op on tree operands.  */
 
 static inline tree
@@ -9119,16 +9095,31 @@ expand_omp_target (struct omp_region *region)
     }
 
   gimple g;
-  tree offload_table = get_offload_symbol_decl ();
   vec<tree> *args;
   /* The maximum number used by any start_ix, without varargs.  */
-  unsigned int argcnt = 12;
+  unsigned int argcnt = 11;
 
   vec_alloc (args, argcnt);
   args->quick_push (device);
   if (offloaded)
     args->quick_push (build_fold_addr_expr (child_fn));
-  args->quick_push (build_fold_addr_expr (offload_table));
+  switch (start_ix)
+    {
+    case BUILT_IN_GOMP_TARGET:
+    case BUILT_IN_GOMP_TARGET_DATA:
+    case BUILT_IN_GOMP_TARGET_UPDATE:
+      /* This const void * is part of the current ABI, but we're not actually
+        using it.  */
+      args->quick_push (build_zero_cst (ptr_type_node));
+      break;
+    case BUILT_IN_GOACC_DATA_START:
+    case BUILT_IN_GOACC_ENTER_EXIT_DATA:
+    case BUILT_IN_GOACC_PARALLEL:
+    case BUILT_IN_GOACC_UPDATE:
+      break;
+    default:
+      gcc_unreachable ();
+    }
   args->quick_push (t1);
   args->quick_push (t2);
   args->quick_push (t3);
index 065dfd4e8a716eb780efbeaf7fda1443bd2ad370..482a968658b1bc95009710b265c6a27294d24ab5 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-19  Thomas Schwinge  <thomas@codesourcery.com>
+
+       * libgomp_g.h (GOACC_data_start, GOACC_enter_exit_data)
+       (GOACC_parallel, GOACC_update): Remove const_void *offload_table
+       formal parameter.  Update all users.
+       * target.c (GOMP_target, GOMP_target_data, GOMP_target_update):
+       Document unused formal parameter.
+
 2015-01-16  Thomas Schwinge  <thomas@codesourcery.com>
 
        * oacc-parallel.c: Don't include <alloca.h>.
index c1e4e6367ab2d12b0fbacb92bd026a09d0b90029..5e88d451b9ab80e8e3a7f17cd49950885675441c 100644 (file)
@@ -217,15 +217,15 @@ extern void GOMP_teams (unsigned int, unsigned int);
 
 /* oacc-parallel.c */
 
-extern void GOACC_data_start (int, const void *,
-                             size_t, void **, size_t *, unsigned short *);
+extern void GOACC_data_start (int, size_t, void **, size_t *,
+                             unsigned short *);
 extern void GOACC_data_end (void);
-extern void GOACC_enter_exit_data (int, const void *, size_t, void **,
+extern void GOACC_enter_exit_data (int, size_t, void **,
                                   size_t *, unsigned short *, int, int, ...);
-extern void GOACC_parallel (int, void (*) (void *), const void *, size_t,
+extern void GOACC_parallel (int, void (*) (void *), size_t,
                            void **, size_t *, unsigned short *, int, int, int,
                            int, int, ...);
-extern void GOACC_update (int, const void *, size_t, void **, size_t *,
+extern void GOACC_update (int, size_t, void **, size_t *,
                          unsigned short *, int, int, ...);
 extern void GOACC_wait (int, int, ...);
 extern int GOACC_get_num_threads (void);
index b5e80603004a50c8ed6263d57066159d54c85e31..a3007428a86d4c3c3c9c3bbe74e7b1b5b09f5bc6 100644 (file)
@@ -75,7 +75,7 @@ select_acc_device (int device_type)
 static void goacc_wait (int async, int num_waits, va_list ap);
 
 void
-GOACC_parallel (int device, void (*fn) (void *), const void *offload_table,
+GOACC_parallel (int device, void (*fn) (void *),
                size_t mapnum, void **hostaddrs, size_t *sizes,
                unsigned short *kinds,
                int num_gangs, int num_workers, int vector_length,
@@ -172,7 +172,7 @@ GOACC_parallel (int device, void (*fn) (void *), const void *offload_table,
 }
 
 void
-GOACC_data_start (int device, const void *offload_table, size_t mapnum,
+GOACC_data_start (int device, size_t mapnum,
                  void **hostaddrs, size_t *sizes, unsigned short *kinds)
 {
   bool host_fallback = device == GOMP_DEVICE_HOST_FALLBACK;
@@ -218,7 +218,7 @@ GOACC_data_end (void)
 }
 
 void
-GOACC_enter_exit_data (int device, const void *offload_table, size_t mapnum,
+GOACC_enter_exit_data (int device, size_t mapnum,
                       void **hostaddrs, size_t *sizes, unsigned short *kinds,
                       int async, int num_waits, ...)
 {
@@ -408,7 +408,7 @@ goacc_wait (int async, int num_waits, va_list ap)
 }
 
 void
-GOACC_update (int device, const void *offload_table, size_t mapnum,
+GOACC_update (int device, size_t mapnum,
              void **hostaddrs, size_t *sizes, unsigned short *kinds,
              int async, int num_waits, ...)
 {
index 72d64fcbd9b08d253d0bece67223c0866e43e022..ebff55e47279c9f3691166bf318dd4fb0beead0f 100644 (file)
@@ -738,15 +738,14 @@ gomp_fini_device (struct gomp_device_descr *devicep)
    is GOMP_DEVICE_ICV, it means use device-var ICV.  If it is
    GOMP_DEVICE_HOST_FALLBACK (or any value
    larger than last available hw device), use host fallback.
-   FN is address of host code, OFFLOAD_TABLE contains value of the
-   __OFFLOAD_TABLE__ symbol in the shared library or binary that invokes
-   GOMP_target.  HOSTADDRS, SIZES and KINDS are arrays
+   FN is address of host code, UNUSED is part of the current ABI, but
+   we're not actually using it.  HOSTADDRS, SIZES and KINDS are arrays
    with MAPNUM entries, with addresses of the host objects,
    sizes of the host objects (resp. for pointer kind pointer bias
    and assumed sizeof (void *) size) and kinds.  */
 
 void
-GOMP_target (int device, void (*fn) (void *), const void *offload_table,
+GOMP_target (int device, void (*fn) (void *), const void *unused,
             size_t mapnum, void **hostaddrs, size_t *sizes,
             unsigned char *kinds)
 {
@@ -817,7 +816,7 @@ GOMP_target (int device, void (*fn) (void *), const void *offload_table,
 }
 
 void
-GOMP_target_data (int device, const void *offload_table, size_t mapnum,
+GOMP_target_data (int device, const void *unused, size_t mapnum,
                  void **hostaddrs, size_t *sizes, unsigned char *kinds)
 {
   struct gomp_device_descr *devicep = resolve_device (device);
@@ -873,7 +872,7 @@ GOMP_target_end_data (void)
 }
 
 void
-GOMP_target_update (int device, const void *offload_table, size_t mapnum,
+GOMP_target_update (int device, const void *unused, size_t mapnum,
                    void **hostaddrs, size_t *sizes, unsigned char *kinds)
 {
   struct gomp_device_descr *devicep = resolve_device (device);
This page took 0.102621 seconds and 5 git commands to generate.