From: Tom de Vries Date: Thu, 5 Apr 2018 08:36:37 +0000 (+0000) Subject: [nvptx] Fix neutering of bb with only cond jump X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ba16fd2eb40c96e41de967ca32e4dea4b5e45a1;p=gcc.git [nvptx] Fix neutering of bb with only cond jump 2018-04-05 Tom de Vries PR target/85204 * config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only cond jump. * testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test. From-SVN: r259125 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e299cb33a7..517ac4e57ae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-04-05 Tom de Vries + + PR target/85204 + * config/nvptx/nvptx.c (nvptx_single): Fix neutering of bb with only + cond jump. + 2018-04-05 Shiva Chen Kito Cheng diff --git a/gcc/config/nvptx/nvptx.c b/gcc/config/nvptx/nvptx.c index b2b150f11d7..a9a3053f336 100644 --- a/gcc/config/nvptx/nvptx.c +++ b/gcc/config/nvptx/nvptx.c @@ -4048,6 +4048,7 @@ nvptx_single (unsigned mask, basic_block from, basic_block to) /* Insert the vector test inside the worker test. */ unsigned mode; rtx_insn *before = tail; + rtx_insn *neuter_start = NULL; for (mode = GOMP_DIM_WORKER; mode <= GOMP_DIM_VECTOR; mode++) if (GOMP_DIM_MASK (mode) & skip_mask) { @@ -4065,7 +4066,10 @@ nvptx_single (unsigned mask, basic_block from, basic_block to) br = gen_br_true (pred, label); else br = gen_br_true_uni (pred, label); - emit_insn_before (br, head); + if (neuter_start) + neuter_start = emit_insn_after (br, neuter_start); + else + neuter_start = emit_insn_before (br, head); LABEL_NUSES (label)++; if (tail_branch) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index a5a5e0631b2..ea28859efda 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2018-04-05 Tom de Vries + + PR target/85204 + * testsuite/libgomp.oacc-c-c++-common/broadcast-1.c: New test. + 2018-03-26 Tom de Vries PR tree-optimization/85063 diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c new file mode 100644 index 00000000000..ca0d37bf88a --- /dev/null +++ b/libgomp/testsuite/libgomp.oacc-c-c++-common/broadcast-1.c @@ -0,0 +1,49 @@ +/* Ensure that worker-vector state conditional expressions are + properly handled by the nvptx backend. */ + +#include +#include + + +#define N 1024 + +int A[N][N] ; + +void test(int x) +{ +#pragma acc parallel num_gangs(16) num_workers(4) vector_length(32) copyout(A) + { +#pragma acc loop gang + for(int j=0;j