Commit be606483 by Tom de Vries Committed by Tom de Vries

[nvptx, PR81352] Add exit insn after noreturn call for neutered threads in warp

2018-01-24  Tom de Vries  <tom@codesourcery.com>

	PR target/81352
	* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
	for neutered threads in warp.
	* config/nvptx/nvptx.md (define_insn "exit"): New insn.

	* testsuite/libgomp.oacc-fortran/pr81352.f90: New test.

From-SVN: r257014
parent 6acfd18c
2018-01-24 Tom de Vries <tom@codesourcery.com>
PR target/81352
* config/nvptx/nvptx.c (nvptx_single): Add exit insn after noreturn call
for neutered threads in warp.
* config/nvptx/nvptx.md (define_insn "exit"): New insn.
2018-01-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/83176
......
......@@ -4062,7 +4062,12 @@ nvptx_single (unsigned mask, basic_block from, basic_block to)
if (tail_branch)
before = emit_label_before (label, before);
else
emit_label_after (label, tail);
{
rtx_insn *label_insn = emit_label_after (label, tail);
if (mode == GOMP_DIM_VECTOR && CALL_P (tail)
&& find_reg_note (tail, REG_NORETURN, NULL))
emit_insn_after (gen_exit (), label_insn);
}
}
/* Now deal with propagating the branch condition. */
......
......@@ -994,6 +994,11 @@
""
"")
(define_insn "exit"
[(const_int 1)]
""
"exit;")
(define_insn "return"
[(return)]
""
......
2018-01-24 Tom de Vries <tom@codesourcery.com>
PR target/81352
* testsuite/libgomp.oacc-fortran/pr81352.f90: New test.
2018-01-19 Tom de Vries <tom@codesourcery.com>
Cesar Philippidis <cesar@codesourcery.com>
......
! { dg-do run }
program foo
integer :: a(3,3), l, ll
a = 0
!$acc parallel num_gangs (1) num_workers(1)
do l=1,3
!$acc loop vector
do ll=1,3
a(l,ll) = 2
enddo
enddo
if (any(a(1:3,1:3).ne.2)) call abort
!$acc end parallel
end program foo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment