aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2015-08-10 18:48:26 +0200
committerThomas Schwinge <tschwinge@gcc.gnu.org>2015-08-10 18:48:26 +0200
commitb97e78b712b21e558a112b7bc683bf05ca7cdcc9 (patch)
tree5b850fb18324259a3fae0131aac6dfa6b6f028fc /gcc
parent44a7d18d95a01b37da666a38188201805c6b578d (diff)
downloadgcc-b97e78b712b21e558a112b7bc683bf05ca7cdcc9.zip
gcc-b97e78b712b21e558a112b7bc683bf05ca7cdcc9.tar.gz
gcc-b97e78b712b21e558a112b7bc683bf05ca7cdcc9.tar.bz2
[PR libgomp/65742, PR middle-end/66332] libgomp: Remove plugin for non-shared memory host execution
gcc/ * builtins.c (expand_builtin_acc_on_device) [ACCEL_COMPILER]: Emit open-coded sequence. * omp-low.c (oacc_process_reduction_data): Remove handline of GOMP_DEVICE_HOST_NONSHM. gcc/testsuite/ * c-c++-common/goacc/acc_on_device-2.c: Remove XFAIL for C. include/ * gomp-constants.c (GOMP_DEVICE_HOST_NONSHM): Remove. libgomp/ * libgomp-plugin.h (enum offload_target_type): Remove OFFLOAD_TARGET_TYPE_HOST_NONSHM. * openacc.f90 (openacc_kinds): Remove acc_device_host_nonshm. * openacc.h (enum acc_device_t): Likewise. * openacc_lib.h: Likewise. * oacc-init.c (name_of_acc_device_t): Don't handle it. (acc_on_device): Just use __builtin_acc_on_device. * testsuite/libgomp.oacc-c-c++-common/if-1.c: Don't forbid usage of acc_on_device builtin. * plugin/plugin-host.h: Remove file. * plugin/plugin-host.c: Likewise, but salvage some content into... * oacc-host.c: ... this file. * plugin/Makefrag.am: Don't build libgomp-plugin-host_nonshm.la. * plugin/configfrag.ac (offload_targets): Don't add host_nonshm. * Makefile.in: Regenerate. * configure: Likewise. * testsuite/lib/libgomp.exp (check_effective_target_openacc_host_nonshm_selected): Remove. * testsuite/libgomp.oacc-c++/c++.exp: Don't handle ACC_DEVICE_TYPE=host_nonshm. * testsuite/libgomp.oacc-c/c.exp: Likewise. * testsuite/libgomp.oacc-fortran/fortran.exp: Likewise. * testsuite/libgomp.oacc-c-c++-common/acc_on_device-1.c: Likewise. * testsuite/libgomp.oacc-fortran/acc_on_device-1-1.f90: Likewise. * testsuite/libgomp.oacc-fortran/acc_on_device-1-2.f: Likewise. * testsuite/libgomp.oacc-fortran/acc_on_device-1-3.f: Likewise. From-SVN: r226763
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/builtins.c12
-rw-r--r--gcc/omp-low.c18
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/c-c++-common/goacc/acc_on_device-2.c10
5 files changed, 20 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f547931..efc177c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2015-08-10 Thomas Schwinge <thomas@codesourcery.com>
+ PR libgomp/65742
+ PR middle-end/66332
+ * builtins.c (expand_builtin_acc_on_device) [ACCEL_COMPILER]: Emit
+ open-coded sequence.
+ * omp-low.c (oacc_process_reduction_data): Remove handline of
+ GOMP_DEVICE_HOST_NONSHM.
+
* lto-streamer-in.c (lto_input_mode_table): Adjust to
GET_MODE_INNER changes.
diff --git a/gcc/builtins.c b/gcc/builtins.c
index eb7b7b2..82229a5 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5879,10 +5879,8 @@ expand_stack_save (void)
acceleration device (ACCEL_COMPILER conditional). */
static rtx
-expand_builtin_acc_on_device (tree exp ATTRIBUTE_UNUSED,
- rtx target ATTRIBUTE_UNUSED)
+expand_builtin_acc_on_device (tree exp, rtx target)
{
-#ifdef ACCEL_COMPILER
if (!validate_arglist (exp, INTEGER_TYPE, VOID_TYPE))
return NULL_RTX;
@@ -5891,8 +5889,13 @@ expand_builtin_acc_on_device (tree exp ATTRIBUTE_UNUSED,
/* Return (arg == v1 || arg == v2) ? 1 : 0. */
machine_mode v_mode = TYPE_MODE (TREE_TYPE (arg));
rtx v = expand_normal (arg), v1, v2;
+#ifdef ACCEL_COMPILER
v1 = GEN_INT (GOMP_DEVICE_NOT_HOST);
v2 = GEN_INT (ACCEL_COMPILER_acc_device);
+#else
+ v1 = GEN_INT (GOMP_DEVICE_NONE);
+ v2 = GEN_INT (GOMP_DEVICE_HOST);
+#endif
machine_mode target_mode = TYPE_MODE (integer_type_node);
if (!target || !register_operand (target, target_mode))
target = gen_reg_rtx (target_mode);
@@ -5906,9 +5909,6 @@ expand_builtin_acc_on_device (tree exp ATTRIBUTE_UNUSED,
emit_label (done_label);
return target;
-#else
- return NULL;
-#endif
}
diff --git a/gcc/omp-low.c b/gcc/omp-low.c
index 0f5c0f1..c1dc919 100644
--- a/gcc/omp-low.c
+++ b/gcc/omp-low.c
@@ -9975,24 +9975,6 @@ oacc_process_reduction_data (gimple_seq *body, gimple_seq *in_stmt_seqp,
in_stmt_seqp);
gimple_seq_add_stmt (in_stmt_seqp, gimple_build_label (exit));
- /* Also, set nthreads = 1 for ACC_DEVICE_TYPE=host_nonshm. */
- gimplify_assign (acc_device_host,
- build_int_cst (integer_type_node,
- GOMP_DEVICE_HOST_NONSHM),
- in_stmt_seqp);
-
- enter = create_artificial_label (UNKNOWN_LOCATION);
- exit = create_artificial_label (UNKNOWN_LOCATION);
-
- stmt = gimple_build_cond (EQ_EXPR, acc_device, acc_device_host,
- enter, exit);
- gimple_seq_add_stmt (in_stmt_seqp, stmt);
- gimple_seq_add_stmt (in_stmt_seqp, gimple_build_label (enter));
- gimplify_assign (nthreads, fold_build1 (NOP_EXPR, sizetype,
- integer_one_node),
- in_stmt_seqp);
- gimple_seq_add_stmt (in_stmt_seqp, gimple_build_label (exit));
-
oacc_initialize_reduction_data (clauses, nthreads, in_stmt_seqp,
ctx);
oacc_finalize_reduction_data (clauses, nthreads, out_stmt_seqp, ctx);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0e707eb..bf858e2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-10 Thomas Schwinge <thomas@codesourcery.com>
+
+ PR libgomp/65742
+ PR middle-end/66332
+ * c-c++-common/goacc/acc_on_device-2.c: Remove XFAIL for C.
+
2015-08-10 Uros Bizjak <ubizjak@gmail.com>
PR fortran/64022
diff --git a/gcc/testsuite/c-c++-common/goacc/acc_on_device-2.c b/gcc/testsuite/c-c++-common/goacc/acc_on_device-2.c
index 6e3d292..ef622a8 100644
--- a/gcc/testsuite/c-c++-common/goacc/acc_on_device-2.c
+++ b/gcc/testsuite/c-c++-common/goacc/acc_on_device-2.c
@@ -20,17 +20,9 @@ f (void)
}
/* With -fopenacc, we're expecting the builtin to be expanded, so no calls.
-
TODO: in C++, even under extern "C", the use of enum for acc_device_t
perturbs expansion as a builtin, which expects an int parameter. It's fine
when changing acc_device_t to plain int, but that's not what we're doing in
<openacc.h>.
- TODO: given that we can't expand acc_on_device in
- gcc/builtins.c:expand_builtin_acc_on_device for in the !ACCEL_COMPILER case
- (because at that point we don't know whether we're acc_device_host or
- acc_device_host_nonshm), we'll (erroneously) get a library call in the host
- code.
-
- { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 0 "expand" { xfail { c || c++ } } } } */
-
+ { dg-final { scan-rtl-dump-times "\\\(call \[^\\n\]* acc_on_device" 0 "expand" { xfail c++ } } } */