1 ; RUN: llc -O2 -tail-dup-size=100 -enable-tail-merge=0 < %s | FileCheck %s
2 ; RUN: %if ptxas %{ llc -O2 -tail-dup-size=100 -enable-tail-merge=0 < %s | %ptxas-verify %}
3 target triple = "nvptx64-nvidia-cuda"
6 declare void @llvm.nvvm.barrier0()
8 ; syncthreads shouldn't be duplicated.
9 ; CHECK: .func call_syncthreads
12 define void @call_syncthreads(ptr %a, ptr %b, i1 %cond, i1 %cond2) nounwind {
13 br i1 %cond, label %L1, label %L2
14 br i1 %cond2, label %Ret, label %L1
24 call void @llvm.nvvm.barrier0()
28 ; Check that call_syncthreads really does trigger tail duplication.
29 ; CHECK: .func call_foo
32 define void @call_foo(ptr %a, ptr %b, i1 %cond, i1 %cond2) nounwind {
33 br i1 %cond, label %L1, label %L2
34 br i1 %cond2, label %Ret, label %L1