1 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
2 ; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s --match-full-lines
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"
8 define spir_func noundef i32 @_Z3foov() #0 {
9 ; CHECK: %[[#foo:]] = OpLabel
11 %0 = call token @llvm.experimental.convergence.entry()
16 define internal spir_func void @main() #2 {
17 ; CHECK: %[[#entry:]] = OpLabel
18 ; CHECK: OpBranch %[[#do1_header:]]
20 %0 = call token @llvm.experimental.convergence.entry()
21 %var = alloca i32, align 4
24 ; CHECK: %[[#do1_header]] = OpLabel
25 ; CHECK: OpLoopMerge %[[#do1_merge:]] %[[#do1_continue:]] None
26 ; CHECK: OpBranch %[[#do1_cond:]]
28 %1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %0) ]
30 br label %do1_continue
32 ; CHECK: %[[#do1_cond]] = OpLabel
33 ; CHECK: OpBranchConditional %[[#]] %[[#do1_continue]] %[[#do1_merge]]
34 ; CHECK: %[[#do1_continue]] = OpLabel
35 ; CHECK: OpBranch %[[#do1_header]]
38 br i1 true, label %do1_header, label %do1_merge
40 ; CHECK: %[[#do1_merge]] = OpLabel
41 ; CHECK: OpBranch %[[#do2_header:]]
46 ; CHECK: %[[#do2_header]] = OpLabel
47 ; CHECK: OpLoopMerge %[[#do2_merge:]] %[[#do2_continue:]] None
48 ; CHECK: OpBranch %[[#do2_cond:]]
50 %4 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %0) ]
52 br label %do2_continue
54 ; CHECK: %[[#do2_cond]] = OpLabel
55 ; CHECK: OpBranchConditional %[[#]] %[[#do2_continue]] %[[#do2_merge]]
56 ; CHECK: %[[#do2_continue]] = OpLabel
57 ; CHECK: OpBranch %[[#do2_header]]
60 br i1 true, label %do2_header, label %do2_merge
62 ; CHECK: %[[#do2_merge]] = OpLabel
63 ; CHECK: OpBranch %[[#do3_header:]]
68 ; CHECK: %[[#do3_header]] = OpLabel
69 ; CHECK: OpLoopMerge %[[#do3_merge:]] %[[#do3_continue:]] None
70 ; CHECK: OpBranch %[[#do3_cond:]]
72 %5 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %0) ]
74 br label %do3_continue
76 ; CHECK: %[[#do3_cond]] = OpLabel
77 ; CHECK: OpBranchConditional %[[#]] %[[#do3_continue]] %[[#do3_merge]]
78 ; CHECK: %[[#do3_continue]] = OpLabel
79 ; CHECK: OpBranch %[[#do3_header]]
82 br i1 true, label %do3_header, label %do3_merge
84 ; CHECK: %[[#do3_merge]] = OpLabel
91 declare token @llvm.experimental.convergence.entry() #1
92 declare token @llvm.experimental.convergence.loop() #1
94 attributes #0 = { convergent noinline nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
95 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
96 attributes #2 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
98 !llvm.module.flags = !{!0, !1, !2}
100 !0 = !{i32 1, !"wchar_size", i32 4}
101 !1 = !{i32 4, !"dx.disable_optimizations", i32 1}
102 !2 = !{i32 7, !"frame-pointer", i32 2}