aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-02-10 11:26:16 +0100
committerTom de Vries <tdevries@suse.de>2022-02-11 08:43:14 +0100
commitfd64b09217fbe8fa33b559e61564071e8aca71e5 (patch)
treea73ba9f38e02cfbb6485b12afa071ed1738b3c67 /gcc
parenta645583d4d68eecdd9101e1013e7bf01907ea786 (diff)
downloadgcc-fd64b09217fbe8fa33b559e61564071e8aca71e5.zip
gcc-fd64b09217fbe8fa33b559e61564071e8aca71e5.tar.gz
gcc-fd64b09217fbe8fa33b559e61564071e8aca71e5.tar.bz2
[nvptx] Handle asm insn in prevent_branch_around_nothing
With GOMP_NVPTX_JIT=-00 and -mptx=3.1, I run into: ... FAIL: libgomp.oacc-c/../libgomp.oacc-c-c++-common/acc_prof-version-1.c \ -DACC_DEVICE_TYPE_nvidia=1 -DACC_MEM_SHARED=0 -foffload=nvptx-none -O2 \ execution test ... The problem is that we're generating a diverging branch around nothing: ... { .reg.u32 %x; mov.u32 %x, %tid.x; setp.ne.u32 %r23, %x, 0; } @%r23 bra $L2; $L2: ... which the driver JIT has problems with at -O0, so consequently we run into the nvptx_uniform_warp_check. Fix this by handling asm ("") and alike in prevent_branch_around_nothing. Tested on x86_64 with nvptx accelerator. gcc/ChangeLog: 2022-02-10 Tom de Vries <tdevries@suse.de> PR target/104456 * config/nvptx/nvptx.cc (prevent_branch_around_nothing): Handle asm insn.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/nvptx/nvptx.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc
index 5b26c0f..afbad5b 100644
--- a/gcc/config/nvptx/nvptx.cc
+++ b/gcc/config/nvptx/nvptx.cc
@@ -5257,6 +5257,14 @@ prevent_branch_around_nothing (void)
case CODE_FOR_nvptx_join:
case CODE_FOR_nop:
continue;
+ case -1:
+ /* Handle asm ("") and similar. */
+ if (GET_CODE (PATTERN (insn)) == ASM_INPUT
+ || GET_CODE (PATTERN (insn)) == ASM_OPERANDS
+ || (GET_CODE (PATTERN (insn)) == PARALLEL
+ && asm_noperands (PATTERN (insn)) >= 0))
+ continue;
+ /* FALLTHROUGH. */
default:
seen_label = NULL;
continue;