forked from KhronosGroup/SPIRV-LLVM-Translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
selection_merge.spt
74 lines (67 loc) · 1.57 KB
/
selection_merge.spt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
119734787 65536 458752 36 0
2 Capability Addresses
2 Capability Linkage
2 Capability Kernel
2 Capability Int64
3 MemoryModel 2 2
9 EntryPoint 6 1 "select_if_dont_flatten"
3 Source 3 102000
3 Name 2 "res"
3 Name 3 "lhs"
3 Name 4 "rhs"
4 Decorate 5 FuncParamAttr 5
2 DecorationGroup 5
4 Decorate 6 BuiltIn 28
3 Decorate 6 Constant
11 Decorate 6 LinkageAttributes "__spirv_GlobalInvocationId" Import
5 GroupDecorate 5 2 3 4
4 TypeInt 7 64 0
4 TypeInt 12 32 1
5 Constant 7 13 32 0
4 Constant 12 14 0
4 TypeVector 8 7 3
4 TypePointer 9 0 8
2 TypeBool 10
2 TypeVoid 11
4 TypePointer 15 5 12
4 TypePointer 16 7 12
6 TypeFunction 17 11 15 15 15
4 Variable 9 6 0
5 Function 11 1 0 17
3 FunctionParameter 15 2
3 FunctionParameter 15 3
3 FunctionParameter 15 4
2 Label 18
6 Load 8 19 6 2 0
5 CompositeExtract 7 20 19 0
5 ShiftLeftLogical 7 21 20 13
5 ShiftRightArithmetic 7 22 21 13
5 InBoundsPtrAccessChain 15 23 3 22
6 Load 12 24 23 2 4
5 InBoundsPtrAccessChain 15 25 4 22
6 Load 12 26 25 2 4
4 Variable 16 27 7
3 Store 27 14
5 SLessThan 10 28 24 26
3 SelectionMerge 29 2
4 BranchConditional 28 30 31
2 Label 30
5 ISub 12 32 26 24
3 Store 27 32
2 Branch 29
2 Label 31
5 ISub 12 33 24 26
3 Store 27 33
2 Branch 29
2 Label 29
4 Load 12 34 27
5 InBoundsPtrAccessChain 15 35 2 22
5 Store 35 34 2 4
1 Return
1 FunctionEnd
; RUN: llvm-spirv %s -to-binary -o %t.spv
; RUN: llvm-spirv %t.spv -to-text -o %t.spt
; RUN: FileCheck < %t.spt %s --check-prefix=CHECK-SPIRV
; RUN: llvm-spirv -r %t.spv -o %t.bc
; CHECK-SPIRV: 3 SelectionMerge {{[0-9]*}} 2
; CHECK-SPIRV-NEXT: 4 BranchConditional {{[0-9]*}} {{[0-9]*}} {{[0-9]*}}