summaryrefslogtreecommitdiff
path: root/test/OpLoopMergeNone.spt
blob: 8566aa1201bd7b56f61ef628450b91013a70775e (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
119734787 65536 458752 45 0
2 Capability Addresses
2 Capability Linkage
2 Capability Kernel
2 Capability Int64
3 MemoryModel 2 2
12 EntryPoint 6 1 "loop_merge_branch_conditional_none"
3 Source 3 102000
3 Name 2 "res"
3 Name 3 "in"
3 Name 4 "rep"
3 Name 5 "num"
4 Decorate 6 FuncParamAttr 5
2 DecorationGroup 6
4 Decorate 7 BuiltIn 28
3 Decorate 7 Constant
11 Decorate 7 LinkageAttributes "__spirv_GlobalInvocationId" Import
4 GroupDecorate 6 2 3
4 TypeInt 8 64 0
4 TypeInt 14 32 1
5 Constant 8 11 32 0
4 Constant 14 15 0
4 Constant 14 16 1
4 TypeVector 9 8 3
4 TypePointer 10 0 9
2 TypeBool 12
2 TypeVoid 13
4 TypePointer 17 5 14
4 TypePointer 18 7 14
7 TypeFunction 19 13 17 17 14 14
4 Variable 10 7 0

5 Function 13 1 0 19
3 FunctionParameter 17 2
3 FunctionParameter 17 3
3 FunctionParameter 14 4
3 FunctionParameter 14 5

2 Label 20
6 Load 9 21 7 2 0
5 CompositeExtract 8 22 21 0
5 ShiftLeftLogical 8 23 22 11
5 ShiftRightArithmetic 8 24 23 11
4 SConvert 14 25 24
4 Variable 18 26 7
4 Variable 18 27 7
5 Store 26 15 2 4
5 Store 27 15 2 4
2 Branch 28

2 Label 28
4 Load 14 29 27
5 SLessThan 12 30 29 4
4 LoopMerge 31 32 0
4 BranchConditional 30 33 31

2 Label 33
4 Load 14 34 27
5 IMul 14 35 34 5
5 IAdd 14 36 25 35
5 InBoundsPtrAccessChain 17 37 3 36
4 Load 14 38 37
4 Load 14 39 26
5 IAdd 14 40 39 38
5 Store 26 40 2 4
2 Branch 32

2 Label 32
4 Load 14 41 27
5 IAdd 14 42 41 16
3 Store 27 42
2 Branch 28

2 Label 31
4 Load 14 43 26
5 InBoundsPtrAccessChain 17 44 2 24
5 Store 44 43 2 4
1 Return

1 FunctionEnd

; RUN: llvm-spirv %s -to-binary -o %t.spv
; RUN: llvm-spirv -r %t.spv -o %t.bc
; RUN: llvm-dis < %t.bc | FileCheck %s --check-prefix=CHECK-LLVM

; CHECK-LLVM: br i1 %{{[0-9]+}}, label %{{[0-9]+}}, label %{{[0-9]+}}, !llvm.loop ![[MD:[0-9]+]]
; CHECK-LLVM: ![[MD]] = distinct !{![[MD]]}