annotate test/CodeGen/AMDGPU/annotate-kernel-features-hsa-call.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; RUN: opt -S -mtriple=amdgcn-unknown-amdhsa -amdgpu-annotate-kernel-features %s | FileCheck -check-prefix=HSA %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 declare i32 @llvm.amdgcn.workgroup.id.x() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4 declare i32 @llvm.amdgcn.workgroup.id.y() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 declare i32 @llvm.amdgcn.workgroup.id.z() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 declare i32 @llvm.amdgcn.workitem.id.x() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 declare i32 @llvm.amdgcn.workitem.id.y() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 declare i32 @llvm.amdgcn.workitem.id.z() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 declare i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 declare i8 addrspace(2)* @llvm.amdgcn.queue.ptr() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 declare i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 declare i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 declare i64 @llvm.amdgcn.dispatch.id() #0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; HSA: define void @use_workitem_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 define void @use_workitem_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 %val = call i32 @llvm.amdgcn.workitem.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 ; HSA: define void @use_workitem_id_y() #2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 define void @use_workitem_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 %val = call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; HSA: define void @use_workitem_id_z() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 define void @use_workitem_id_z() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 %val = call i32 @llvm.amdgcn.workitem.id.z()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 ; HSA: define void @use_workgroup_id_x() #4 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 define void @use_workgroup_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 %val = call i32 @llvm.amdgcn.workgroup.id.x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ; HSA: define void @use_workgroup_id_y() #5 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 define void @use_workgroup_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 %val = call i32 @llvm.amdgcn.workgroup.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 ; HSA: define void @use_workgroup_id_z() #6 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53 define void @use_workgroup_id_z() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 %val = call i32 @llvm.amdgcn.workgroup.id.z()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 ; HSA: define void @use_dispatch_ptr() #7 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 define void @use_dispatch_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 %dispatch.ptr = call i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 store volatile i8 addrspace(2)* %dispatch.ptr, i8 addrspace(2)* addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ; HSA: define void @use_queue_ptr() #8 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 define void @use_queue_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 %queue.ptr = call i8 addrspace(2)* @llvm.amdgcn.queue.ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 store volatile i8 addrspace(2)* %queue.ptr, i8 addrspace(2)* addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 ; HSA: define void @use_dispatch_id() #9 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 define void @use_dispatch_id() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 %val = call i64 @llvm.amdgcn.dispatch.id()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76 store volatile i64 %val, i64 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
77 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
78 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
79
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
80 ; HSA: define void @use_workgroup_id_y_workgroup_id_z() #10 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
81 define void @use_workgroup_id_y_workgroup_id_z() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
82 %val0 = call i32 @llvm.amdgcn.workgroup.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
83 %val1 = call i32 @llvm.amdgcn.workgroup.id.z()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
84 store volatile i32 %val0, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
85 store volatile i32 %val1, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
86 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
87 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
88
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
89 ; HSA: define void @func_indirect_use_workitem_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
90 define void @func_indirect_use_workitem_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
91 call void @use_workitem_id_x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
92 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
93 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
94
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
95 ; HSA: define void @kernel_indirect_use_workitem_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
96 define void @kernel_indirect_use_workitem_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
97 call void @use_workitem_id_x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
98 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
99 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
100
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
101 ; HSA: define void @func_indirect_use_workitem_id_y() #2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
102 define void @func_indirect_use_workitem_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
103 call void @use_workitem_id_y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
104 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
105 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
106
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
107 ; HSA: define void @func_indirect_use_workitem_id_z() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
108 define void @func_indirect_use_workitem_id_z() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
109 call void @use_workitem_id_z()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
110 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
111 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
112
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
113 ; HSA: define void @func_indirect_use_workgroup_id_x() #4 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
114 define void @func_indirect_use_workgroup_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
115 call void @use_workgroup_id_x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
116 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
117 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
118
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
119 ; HSA: define void @kernel_indirect_use_workgroup_id_x() #4 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
120 define void @kernel_indirect_use_workgroup_id_x() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
121 call void @use_workgroup_id_x()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
122 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
123 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
124
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
125 ; HSA: define void @func_indirect_use_workgroup_id_y() #5 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
126 define void @func_indirect_use_workgroup_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
127 call void @use_workgroup_id_y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
128 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
129 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
130
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
131 ; HSA: define void @func_indirect_use_workgroup_id_z() #6 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
132 define void @func_indirect_use_workgroup_id_z() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
133 call void @use_workgroup_id_z()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
134 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
135 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
136
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
137 ; HSA: define void @func_indirect_indirect_use_workgroup_id_y() #5 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
138 define void @func_indirect_indirect_use_workgroup_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
139 call void @func_indirect_use_workgroup_id_y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
140 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
141 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
142
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
143 ; HSA: define void @indirect_x2_use_workgroup_id_y() #5 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
144 define void @indirect_x2_use_workgroup_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
145 call void @func_indirect_indirect_use_workgroup_id_y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
146 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
147 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
148
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
149 ; HSA: define void @func_indirect_use_dispatch_ptr() #7 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
150 define void @func_indirect_use_dispatch_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
151 call void @use_dispatch_ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
152 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
153 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
154
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
155 ; HSA: define void @func_indirect_use_queue_ptr() #8 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
156 define void @func_indirect_use_queue_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
157 call void @use_queue_ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
158 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
159 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
160
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
161 ; HSA: define void @func_indirect_use_dispatch_id() #9 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
162 define void @func_indirect_use_dispatch_id() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
163 call void @use_dispatch_id()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
164 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
165 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
166
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
167 ; HSA: define void @func_indirect_use_workgroup_id_y_workgroup_id_z() #11 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
168 define void @func_indirect_use_workgroup_id_y_workgroup_id_z() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
169 call void @func_indirect_use_workgroup_id_y_workgroup_id_z()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
170 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
171 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
172
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
173 ; HSA: define void @recursive_use_workitem_id_y() #2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
174 define void @recursive_use_workitem_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
175 %val = call i32 @llvm.amdgcn.workitem.id.y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
176 store volatile i32 %val, i32 addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
177 call void @recursive_use_workitem_id_y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
178 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
179 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
180
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
181 ; HSA: define void @call_recursive_use_workitem_id_y() #2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
182 define void @call_recursive_use_workitem_id_y() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
183 call void @recursive_use_workitem_id_y()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
184 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
185 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
186
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
187 ; HSA: define void @use_group_to_flat_addrspacecast(i32 addrspace(3)* %ptr) #8 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
188 define void @use_group_to_flat_addrspacecast(i32 addrspace(3)* %ptr) #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
189 %stof = addrspacecast i32 addrspace(3)* %ptr to i32 addrspace(4)*
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
190 store volatile i32 0, i32 addrspace(4)* %stof
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
191 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
192 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
193
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
194 ; HSA: define void @use_group_to_flat_addrspacecast_gfx9(i32 addrspace(3)* %ptr) #12 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
195 define void @use_group_to_flat_addrspacecast_gfx9(i32 addrspace(3)* %ptr) #2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
196 %stof = addrspacecast i32 addrspace(3)* %ptr to i32 addrspace(4)*
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
197 store volatile i32 0, i32 addrspace(4)* %stof
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
198 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
199 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
200
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
201 ; HSA: define void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(i32 addrspace(3)* %ptr) #13 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
202 define void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(i32 addrspace(3)* %ptr) #2 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
203 %stof = addrspacecast i32 addrspace(3)* %ptr to i32 addrspace(4)*
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
204 store volatile i32 0, i32 addrspace(4)* %stof
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
205 call void @func_indirect_use_queue_ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
206 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
207 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
208
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
209 ; HSA: define void @indirect_use_group_to_flat_addrspacecast() #8 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
210 define void @indirect_use_group_to_flat_addrspacecast() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
211 call void @use_group_to_flat_addrspacecast(i32 addrspace(3)* null)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
212 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
213 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
214
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
215 ; HSA: define void @indirect_use_group_to_flat_addrspacecast_gfx9() #11 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
216 define void @indirect_use_group_to_flat_addrspacecast_gfx9() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
217 call void @use_group_to_flat_addrspacecast_gfx9(i32 addrspace(3)* null)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
218 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
219 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
220
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
221 ; HSA: define void @indirect_use_group_to_flat_addrspacecast_queue_ptr_gfx9() #8 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
222 define void @indirect_use_group_to_flat_addrspacecast_queue_ptr_gfx9() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
223 call void @use_group_to_flat_addrspacecast_queue_ptr_gfx9(i32 addrspace(3)* null)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
224 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
225 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
226
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
227 ; HSA: define void @use_kernarg_segment_ptr() #14 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
228 define void @use_kernarg_segment_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
229 %kernarg.segment.ptr = call i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
230 store volatile i8 addrspace(2)* %kernarg.segment.ptr, i8 addrspace(2)* addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
231 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
232 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
233
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
234 ; HSA: define void @func_indirect_use_kernarg_segment_ptr() #14 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
235 define void @func_indirect_use_kernarg_segment_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
236 call void @use_kernarg_segment_ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
237 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
238 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
239
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
240 ; HSA: define amdgpu_kernel void @kern_use_implicitarg_ptr() #15 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
241 define amdgpu_kernel void @kern_use_implicitarg_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
242 %implicitarg.ptr = call i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
243 store volatile i8 addrspace(2)* %implicitarg.ptr, i8 addrspace(2)* addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
244 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
245 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
246
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
247 ; HSA: define void @use_implicitarg_ptr() #15 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
248 define void @use_implicitarg_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
249 %implicitarg.ptr = call i8 addrspace(2)* @llvm.amdgcn.implicitarg.ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
250 store volatile i8 addrspace(2)* %implicitarg.ptr, i8 addrspace(2)* addrspace(1)* undef
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
251 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
252 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
253
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
254 ; HSA: define void @func_indirect_use_implicitarg_ptr() #15 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
255 define void @func_indirect_use_implicitarg_ptr() #1 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
256 call void @use_implicitarg_ptr()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
257 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
258 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
259
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
260 ; HSA: declare void @external.func() #16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
261 declare void @external.func() #3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
262
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
263 ; HSA: define internal void @defined.func() #16 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
264 define internal void @defined.func() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
265 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
266 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
267
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
268 ; HSA: define void @func_call_external() #16 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
269 define void @func_call_external() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
270 call void @external.func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
271 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
272 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
273
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
274 ; HSA: define void @func_call_defined() #16 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
275 define void @func_call_defined() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
276 call void @defined.func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
277 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
278 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
279
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
280 ; HSA: define void @func_call_asm() #16 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
281 define void @func_call_asm() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
282 call void asm sideeffect "", ""() #3
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
283 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
284 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
285
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
286 ; HSA: define amdgpu_kernel void @kern_call_external() #17 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
287 define amdgpu_kernel void @kern_call_external() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
288 call void @external.func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
289 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
290 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
291
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
292 ; HSA: define amdgpu_kernel void @func_kern_defined() #17 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
293 define amdgpu_kernel void @func_kern_defined() #3 {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
294 call void @defined.func()
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
295 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
296 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
297
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
298 attributes #0 = { nounwind readnone speculatable }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
299 attributes #1 = { nounwind "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
300 attributes #2 = { nounwind "target-cpu"="gfx900" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
301 attributes #3 = { nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
302
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
303 ; HSA: attributes #0 = { nounwind readnone speculatable }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
304 ; HSA: attributes #1 = { nounwind "amdgpu-work-item-id-x" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
305 ; HSA: attributes #2 = { nounwind "amdgpu-work-item-id-y" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
306 ; HSA: attributes #3 = { nounwind "amdgpu-work-item-id-z" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
307 ; HSA: attributes #4 = { nounwind "amdgpu-work-group-id-x" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
308 ; HSA: attributes #5 = { nounwind "amdgpu-work-group-id-y" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
309 ; HSA: attributes #6 = { nounwind "amdgpu-work-group-id-z" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
310 ; HSA: attributes #7 = { nounwind "amdgpu-dispatch-ptr" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
311 ; HSA: attributes #8 = { nounwind "amdgpu-queue-ptr" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
312 ; HSA: attributes #9 = { nounwind "amdgpu-dispatch-id" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
313 ; HSA: attributes #10 = { nounwind "amdgpu-work-group-id-y" "amdgpu-work-group-id-z" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
314 ; HSA: attributes #11 = { nounwind "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
315 ; HSA: attributes #12 = { nounwind "target-cpu"="gfx900" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
316 ; HSA: attributes #13 = { nounwind "amdgpu-queue-ptr" "target-cpu"="gfx900" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
317 ; HSA: attributes #14 = { nounwind "amdgpu-kernarg-segment-ptr" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
318 ; HSA: attributes #15 = { nounwind "amdgpu-implicitarg-ptr" "target-cpu"="fiji" }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
319 ; HSA: attributes #16 = { nounwind }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
320 ; HSA: attributes #17 = { nounwind "amdgpu-flat-scratch" }