[Frontend] Remove unused includes (NFC) (#116927)
[llvm-project.git] / llvm / test / CodeGen / SPIRV / structurizer / do-nested.ll
blobbef95f5f63bf7bfe8f449fb6f1453ba03d8ea3ff
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
9 entry:
10   %0 = call token @llvm.experimental.convergence.entry()
11   %var = alloca i32, align 4
12   br label %do1_header
14 ; CHECK:    %[[#do1_header:]] = OpLabel
15 ; CHECK:                        OpLoopMerge %[[#do1_merge:]] %[[#do1_continue:]] None
16 ; CHECK:                        OpBranch %[[#do2_header:]]
17 do1_header:
18   %1 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %0) ]
19   store i32 0, ptr %var
20   br label %do2_header
22 ; CHECK:    %[[#do2_header:]] = OpLabel
23 ; CHECK:                        OpLoopMerge %[[#do2_merge:]] %[[#do2_continue:]] None
24 ; CHECK:                        OpBranch %[[#do3_header:]]
25 do2_header:
26   %4 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %1) ]
27   store i32 0, ptr %var
28   br label %do3_header
30 ; CHECK:    %[[#do3_header:]] = OpLabel
31 ; CHECK:                        OpLoopMerge %[[#do3_merge:]] %[[#do3_continue:]] None
32 ; CHECK:                        OpBranch %[[#do3_cond:]]
33 do3_header:
34   %5 = call token @llvm.experimental.convergence.loop() [ "convergencectrl"(token %4) ]
35   store i32 0, ptr %var
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]]
42 do3_continue:
43   store i32 0, ptr %var
44   br i1 true, label %do3_header, label %do3_merge
46 ; CHECK:    %[[#do3_merge]] = OpLabel
47 ; CHECK:                      OpBranch %[[#do2_cond:]]
48 do3_merge:
49   store i32 0, ptr %var
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]]
56 do2_continue:
57   store i32 0, ptr %var
58   br i1 true, label %do2_header, label %do2_merge
60 ; CHECK:    %[[#do2_merge]] = OpLabel
61 ; CHECK:                      OpBranch %[[#do1_cond:]]
62 do2_merge:
63   store i32 0, ptr %var
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]]
70 do1_continue:
71   store i32 0, ptr %var
72   br i1 true, label %do1_header, label %do1_merge
74 ; CHECK:    %[[#do1_merge]] = OpLabel
75 ; CHECK:                      OpReturn
76 do1_merge:
77   ret void
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}