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 %}
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 ; Function Attrs: convergent noinline norecurse nounwind optnone
8 define spir_func noundef i32 @_Z7processv() #0 {
10 ; CHECK-DAG: %[[#int_0:]] = OpConstant %[[#]] 0
11 ; CHECK-DAG: %[[#int_1:]] = OpConstant %[[#]] 1
13 ; CHECK: %[[#entry:]] = OpLabel
14 ; CHECK: %[[#var:]] = OpVariable %[[#]] Function
15 ; CHECK: OpSelectionMerge %[[#merge:]] None
16 ; CHECK: OpBranchConditional %[[#]] %[[#left:]] %[[#right:]]
18 %0 = call token @llvm.experimental.convergence.entry()
19 br i1 true, label %left, label %right
21 ; CHECK: %[[#left]] = OpLabel
22 ; CHECK-NEXT: OpStore %[[#var]] %[[#int_0]]
23 ; CHECK-NEXT: OpBranch %[[#merge]]
27 ; CHECK: %[[#right]] = OpLabel
28 ; CHECK-NEXT: OpStore %[[#var]] %[[#int_1]]
29 ; CHECK-NEXT: OpBranch %[[#merge]]
33 ; CHECK: %[[#merge]] = OpLabel
34 ; CHECK: %[[#tmp:]] = OpLoad %[[#]] %[[#var]]
35 ; CHECK: OpReturnValue %[[#tmp]]
37 %1 = phi i32 [ 0, %left ], [ 1, %right ]
41 ; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none)
42 declare token @llvm.experimental.convergence.entry() #1
44 ; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none)
45 declare token @llvm.experimental.convergence.loop() #1
48 attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
49 attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
50 attributes #2 = { convergent norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
51 attributes #3 = { convergent }
53 !llvm.module.flags = !{!0, !1, !2}
56 !0 = !{i32 1, !"wchar_size", i32 4}
57 !1 = !{i32 4, !"dx.disable_optimizations", i32 1}
58 !2 = !{i32 7, !"frame-pointer", i32 2}