1 ; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s --match-full-lines
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
4 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
5 target triple = "spirv-unknown-vulkan1.3-compute"
7 define internal spir_func void @main() #0 {
8 ; CHECK: %[[#entry:]] = OpLabel
10 %0 = call token @llvm.experimental.convergence.entry()
11 %var = alloca i32, align 4
14 ; CHECK: %[[#do1_header:]] = OpLabel
15 ; CHECK: OpLoopMerge %[[#do1_merge:]] %[[#do1_continue:]] None
16 ; CHECK: OpBranch %[[#do2_header:]]
18 %1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %0) ]
22 ; CHECK: %[[#do2_header:]] = OpLabel
23 ; CHECK: OpLoopMerge %[[#do2_merge:]] %[[#do2_continue:]] None
24 ; CHECK: OpBranch %[[#do3_header:]]
26 %4 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %1) ]
30 ; CHECK: %[[#do3_header:]] = OpLabel
31 ; CHECK: OpLoopMerge %[[#do3_merge:]] %[[#do3_continue:]] None
32 ; CHECK: OpBranch %[[#do3_cond:]]
34 %5 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %4) ]
36 br label %do3_continue
38 ; CHECK: %[[#do3_cond]] = OpLabel
39 ; CHECK: OpBranchConditional %[[#]] %[[#do3_continue]] %[[#do3_merge]]
40 ; CHECK: %[[#do3_continue]] = OpLabel
41 ; CHECK: OpBranch %[[#do3_header]]
44 br i1 true, label %do3_header, label %do3_merge
46 ; CHECK: %[[#do3_merge]] = OpLabel
47 ; CHECK: OpBranch %[[#do2_cond:]]
50 br label %do2_continue
52 ; CHECK: %[[#do2_cond]] = OpLabel
53 ; CHECK: OpBranchConditional %[[#]] %[[#do2_continue]] %[[#do2_merge]]
54 ; CHECK: %[[#do2_continue]] = OpLabel
55 ; CHECK: OpBranch %[[#do2_header]]
58 br i1 true, label %do2_header, label %do2_merge
60 ; CHECK: %[[#do2_merge]] = OpLabel
61 ; CHECK: OpBranch %[[#do1_cond:]]
64 br label %do1_continue
66 ; CHECK: %[[#do1_cond]] = OpLabel
67 ; CHECK: OpBranchConditional %[[#]] %[[#do1_continue]] %[[#do1_merge]]
68 ; CHECK: %[[#do1_continue]] = OpLabel
69 ; CHECK: OpBranch %[[#do1_header]]
72 br i1 true, label %do1_header, label %do1_merge
74 ; CHECK: %[[#do1_merge]] = OpLabel
80 declare token @llvm.experimental.convergence.entry() #1
81 declare token @llvm.experimental.convergence.loop() #1
83 attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
84 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
86 !llvm.module.flags = !{!0, !1, !2}
88 !0 = !{i32 1, !"wchar_size", i32 4}
89 !1 = !{i32 4, !"dx.disable_optimizations", i32 1}
90 !2 = !{i32 7, !"frame-pointer", i32 2}