1 ; RUN: llc -mtriple=spirv-unknown-vulkan-compute -O0 %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
23 ; [numthreads(1, 1, 1)]
28 ; CHECK: %[[#func_13:]] = OpFunction %[[#uint:]] DontInline %[[#]]
29 ; CHECK: %[[#bb25:]] = OpLabel
30 ; CHECK: OpSelectionMerge %[[#bb26:]] None
31 ; CHECK: OpBranchConditional %[[#]] %[[#bb27:]] %[[#bb28:]]
32 ; CHECK: %[[#bb27:]] = OpLabel
33 ; CHECK: OpSelectionMerge %[[#bb29:]] None
34 ; CHECK: OpSwitch %[[#]] %[[#bb30:]] 50 %[[#bb31:]] 4 %[[#bb29:]] 5 %[[#bb32:]]
35 ; CHECK: %[[#bb28:]] = OpLabel
36 ; CHECK: %[[#bb30:]] = OpLabel
37 ; CHECK: OpBranch %[[#bb29:]]
38 ; CHECK: %[[#bb31:]] = OpLabel
39 ; CHECK: OpBranch %[[#bb29:]]
40 ; CHECK: %[[#bb32:]] = OpLabel
41 ; CHECK: OpBranch %[[#bb29:]]
42 ; CHECK: %[[#bb29:]] = OpLabel
43 ; CHECK: OpBranchConditional %[[#]] %[[#bb33:]] %[[#bb26:]]
44 ; CHECK: %[[#bb33:]] = OpLabel
45 ; CHECK: OpBranch %[[#bb26:]]
46 ; CHECK: %[[#bb26:]] = OpLabel
47 ; CHECK: OpReturnValue %[[#]]
48 ; CHECK: OpFunctionEnd
49 ; CHECK: %[[#func_21:]] = OpFunction %[[#void:]] DontInline %[[#]]
50 ; CHECK: %[[#bb34:]] = OpLabel
52 ; CHECK: OpFunctionEnd
53 ; CHECK: %[[#func_23:]] = OpFunction %[[#void:]] None %[[#]]
54 ; CHECK: %[[#bb35:]] = OpLabel
56 ; CHECK: OpFunctionEnd
60 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
61 target triple = "spirv-unknown-vulkan1.3-compute"
63 ; Function Attrs: convergent noinline norecurse nounwind optnone
64 define spir_func noundef i32 @_Z7processv() #0 {
66 %0 = call token @llvm.experimental.convergence.entry()
67 %b = alloca i32, align 4
68 %t = alloca i32, align 4
69 %d = alloca i32, align 4
70 store i32 0, ptr %b, align 4
71 store i32 50, ptr %t, align 4
72 store i32 5, ptr %d, align 4
73 %1 = load i32, ptr %d, align 4
74 switch i32 %1, label %sw.default [
80 sw.bb: ; preds = %entry
81 store i32 50, ptr %b, align 4
84 sw.bb1: ; preds = %entry, %entry, %sw.bb
85 store i32 5, ptr %b, align 4
88 sw.default: ; preds = %entry
91 sw.epilog: ; preds = %sw.default, %sw.bb1
92 %2 = load i32, ptr %b, align 4
96 ; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none)
97 declare token @llvm.experimental.convergence.entry() #1
99 ; Function Attrs: convergent noinline norecurse nounwind optnone
100 define internal spir_func void @main() #0 {
102 %0 = call token @llvm.experimental.convergence.entry()
103 %call1 = call spir_func noundef i32 @_Z7processv() #3 [ "convergencectrl"(token %0) ]
107 ; Function Attrs: convergent norecurse
108 define void @main.1() #2 {
114 attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
115 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
116 attributes #2 = { convergent norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
117 attributes #3 = { convergent }
119 !llvm.module.flags = !{!0, !1, !2}
122 !0 = !{i32 1, !"wchar_size", i32 4}
123 !1 = !{i32 4, !"dx.disable_optimizations", i32 1}
124 !2 = !{i32 7, !"frame-pointer", i32 2}