I've applied this to gomp4 to apply some changes to these areas that occurred on
merging to trunk.
nathan
2015-10-01 Nathan Sidwell <nat...@codesourcery.com>
* config/nvptx/nvptx.c (nvptx_validate_dims): Rename to ...
(nvptx_goacc_validate_dims): ... here.
(TARGET_GOACC_VALIDATE_DIMS): Update.
* target.def (validate_dims): Expand documentation.
* omp-low.c (default_goacc_validate_dims): Remove erroneous ARG_UNUSED.
* doc/tm.texi: Rebuild.
Index: gcc/config/nvptx/nvptx.c
===================================================================
--- gcc/config/nvptx/nvptx.c (revision 228304)
+++ gcc/config/nvptx/nvptx.c (working copy)
@@ -4248,12 +4248,12 @@ nvptx_expand_builtin (tree exp, rtx targ
#define PTX_VECTOR_LENGTH 32
#define PTX_WORKER_LENGTH 32
-/* Validate compute dimensions, fill in non-unity defaults. FN_LEVEL
- indicates the level at which a routine might spawn a loop. It is
- negative for non-routines. */
+/* Validate compute dimensions of an OpenACC offload or routine, fill
+ in non-unity defaults. FN_LEVEL indicates the level at which a
+ routine might spawn a loop. It is negative for non-routines. */
static bool
-nvptx_validate_dims (tree decl, int dims[], int fn_level)
+nvptx_goacc_validate_dims (tree decl, int dims[], int fn_level)
{
bool changed = false;
@@ -4856,7 +4856,7 @@ nvptx_use_anchors_for_symbol (const_rtx
#define TARGET_BUILTIN_DECL nvptx_builtin_decl
#undef TARGET_GOACC_VALIDATE_DIMS
-#define TARGET_GOACC_VALIDATE_DIMS nvptx_validate_dims
+#define TARGET_GOACC_VALIDATE_DIMS nvptx_goacc_validate_dims
#undef TARGET_GOACC_DIM_LIMIT
#define TARGET_GOACC_DIM_LIMIT nvptx_dim_limit
Index: gcc/target.def
===================================================================
--- gcc/target.def (revision 228304)
+++ gcc/target.def (working copy)
@@ -1646,11 +1646,15 @@ HOOK_VECTOR (TARGET_GOACC, goacc)
DEFHOOK
(validate_dims,
-"This hook should check the launch dimensions provided. It should fill\n\
-in anything that needs to default to non-unity and verify non-defaults.\n\
-Defaults are represented as -1. Diagnostics should be issued as\n\
-appropriate. Return true if changes have been made. You must override\n\
-this hook to provide dimensions larger than 1.",
+"This hook should check the launch dimensions provided for an OpenACC\n\
+compute region, or routine. Defaulted values are represented as -1\n\
+and non-constant values as 0. The @var{fn_level} is negative for the\n\
+function corresponding to the compute region. For a routine is is the\n\
+outermost level at which partitioned execution may be spawned. It\n\
+should fill in anything that needs to default to non-unity and verify\n\
+non-defaults. Diagnostics should be issued as appropriate. Return\n\
+true, if changes have been made. You must override this hook to\n\
+provide dimensions larger than 1.",
bool, (tree decl, int dims[], int fn_level),
default_goacc_validate_dims)
Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi (revision 228304)
+++ gcc/doc/tm.texi (working copy)
@@ -5749,11 +5749,15 @@ to use it.
@end deftypefn
@deftypefn {Target Hook} bool TARGET_GOACC_VALIDATE_DIMS (tree @var{decl}, int @var{dims[]}, int @var{fn_level})
-This hook should check the launch dimensions provided. It should fill
-in anything that needs to default to non-unity and verify non-defaults.
-Defaults are represented as -1. Diagnostics should be issued as
-appropriate. Return true if changes have been made. You must override
-this hook to provide dimensions larger than 1.
+This hook should check the launch dimensions provided for an OpenACC
+compute region, or routine. Defaulted values are represented as -1
+and non-constant values as 0. The @var{fn_level} is negative for the
+function corresponding to the compute region. For a routine is is the
+outermost level at which partitioned execution may be spawned. It
+should fill in anything that needs to default to non-unity and verify
+non-defaults. Diagnostics should be issued as appropriate. Return
+true, if changes have been made. You must override this hook to
+provide dimensions larger than 1.
@end deftypefn
@deftypefn {Target Hook} unsigned TARGET_GOACC_DIM_LIMIT (unsigned @var{axis})
Index: gcc/omp-low.c
===================================================================
--- gcc/omp-low.c (revision 228304)
+++ gcc/omp-low.c (working copy)
@@ -14904,7 +14904,7 @@ execute_oacc_device_lower ()
hook. */
bool
-default_goacc_validate_dims (tree ARG_UNUSED (decl), int *ARG_UNUSED (dims),
+default_goacc_validate_dims (tree ARG_UNUSED (decl), int *dims,
int ARG_UNUSED (fn_level))
{
bool changed = false;