47 lines · plain
1; RUN: llc -O2 -tail-dup-size=100 -enable-tail-merge=0 < %s | FileCheck %s2; RUN: %if ptxas %{ llc -O2 -tail-dup-size=100 -enable-tail-merge=0 < %s | %ptxas-verify %}3target triple = "nvptx64-nvidia-cuda"4 5declare void @foo()6declare void @llvm.nvvm.barrier0()7 8; syncthreads shouldn't be duplicated.9; CHECK: .func call_syncthreads10; CHECK: bar.sync11; CHECK-NOT: bar.sync12define void @call_syncthreads(ptr %a, ptr %b, i1 %cond, i1 %cond2) nounwind {13 br i1 %cond, label %L1, label %L214 br i1 %cond2, label %Ret, label %L115Ret:16 ret void17L1:18 store i32 0, ptr %a19 br label %L4220L2:21 store i32 1, ptr %a22 br label %L4223L42:24 call void @llvm.nvvm.barrier0()25 br label %Ret26}27 28; Check that call_syncthreads really does trigger tail duplication.29; CHECK: .func call_foo30; CHECK: call31; CHECK: call32define void @call_foo(ptr %a, ptr %b, i1 %cond, i1 %cond2) nounwind {33 br i1 %cond, label %L1, label %L234 br i1 %cond2, label %Ret, label %L135Ret:36 ret void37L1:38 store i32 0, ptr %a39 br label %L4240L2:41 store i32 1, ptr %a42 br label %L4243L42:44 call void @foo()45 br label %Ret46}47