xref: /llvm-project/llvm/test/CodeGen/SPIRV/structurizer/cf.return.void.ll (revision 1ed65febd996eaa018164e880c87a9e9afc6f68d)
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 %}
3
4;
5; void A() {
6; }
7;
8; [numthreads(1, 1, 1)]
9; void main() {
10;   return A();
11; }
12
13; CHECK: %[[#func_3:]] = OpFunction %[[#void:]] DontInline %[[#]]
14; CHECK:    %[[#bb8:]] = OpLabel
15; CHECK:                 OpReturn
16; CHECK:                 OpFunctionEnd
17; CHECK: %[[#func_4:]] = OpFunction %[[#void:]] DontInline %[[#]]
18; CHECK:    %[[#bb9:]] = OpLabel
19; CHECK:                 OpReturn
20; CHECK:                 OpFunctionEnd
21; CHECK: %[[#func_6:]] = OpFunction %[[#void:]] None %[[#]]
22; CHECK:   %[[#bb10:]] = OpLabel
23; CHECK:                 OpReturn
24; CHECK:                 OpFunctionEnd
25
26
27
28target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-G1"
29target triple = "spirv-unknown-vulkan1.3-compute"
30
31; Function Attrs: convergent noinline norecurse nounwind optnone
32define spir_func void @_Z1Av() #0 {
33entry:
34  %0 = call token @llvm.experimental.convergence.entry()
35  ret void
36}
37
38; Function Attrs: convergent nocallback nofree nosync nounwind willreturn memory(none)
39declare token @llvm.experimental.convergence.entry() #1
40
41; Function Attrs: convergent noinline norecurse nounwind optnone
42define internal spir_func void @main() #0 {
43entry:
44  %0 = call token @llvm.experimental.convergence.entry()
45  call spir_func void @_Z1Av() #3 [ "convergencectrl"(token %0) ]
46  ret void
47}
48
49; Function Attrs: convergent norecurse
50define void @main.1() #2 {
51entry:
52  call void @main()
53  ret void
54}
55
56attributes #0 = { convergent noinline norecurse nounwind optnone "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
57attributes #1 = { convergent nocallback nofree nosync nounwind willreturn memory(none) }
58attributes #2 = { convergent norecurse "frame-pointer"="all" "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
59attributes #3 = { convergent }
60
61!llvm.module.flags = !{!0, !1, !2}
62
63
64!0 = !{i32 1, !"wchar_size", i32 4}
65!1 = !{i32 4, !"dx.disable_optimizations", i32 1}
66!2 = !{i32 7, !"frame-pointer", i32 2}
67
68
69