summaryrefslogtreecommitdiff
path: root/gcc/config/i386
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/i386')
-rw-r--r--gcc/config/i386/i386.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 59101d8028a..c50f4dac199 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -22711,6 +22711,35 @@ ix86_push_rounding (poly_int64 bytes)
return ROUND_UP (bytes, UNITS_PER_WORD);
}
+/* Return TRUE if offloaded OpenACC target-code regions should have their
+ parameters passed as separate function arguments, rather than in an array.
+ This can be a performance win on some (NVidia) GPUs. */
+
+bool
+ix86_goacc_explode_args (void)
+{
+#ifdef OFFLOAD_TARGETS
+ const char *offload_targets = OFFLOAD_TARGETS;
+ if (strstr (offload_targets, "nvptx"))
+ {
+ if (strchr (offload_targets, ','))
+ {
+ static bool warned_ptx_args = false;
+ if (!warned_ptx_args)
+ {
+ warning (0, "NVidia PTX parameter-passing optimization disabled "
+ "with multiple offload targets");
+ warned_ptx_args = true;
+ }
+ return false;
+ }
+ return true;
+ }
+
+#endif
+ return false;
+}
+
/* Target-specific selftests. */
#if CHECKING_P
@@ -23496,6 +23525,9 @@ static bool ix86_libc_has_fast_function (int fcode ATTRIBUTE_UNUSED)
#undef TARGET_LIBC_HAS_FAST_FUNCTION
#define TARGET_LIBC_HAS_FAST_FUNCTION ix86_libc_has_fast_function
+#undef TARGET_GOACC_EXPLODE_ARGS
+#define TARGET_GOACC_EXPLODE_ARGS ix86_goacc_explode_args
+
#if CHECKING_P
#undef TARGET_RUN_TARGET_SELFTESTS
#define TARGET_RUN_TARGET_SELFTESTS selftest::ix86_run_selftests