• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=NOTES %s
2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX803 --check-prefix=NOTES %s
3; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %s
4
5; CHECK: ---
6; CHECK:  Version: [ 1, 0 ]
7; CHECK:  Kernels:
8
9; CHECK:      - Name:       test0
10; CHECK:        SymbolName: 'test0@kd'
11; CHECK:        Args:
12; CHECK-NEXT:     - Name:            r
13; CHECK-NEXT:       Size:            8
14; CHECK-NEXT:       Align:           8
15; CHECK-NEXT:       ValueKind:       GlobalBuffer
16; CHECK-NEXT:       ValueType:       F16
17; CHECK-NEXT:       AddrSpaceQual:   Global
18; CHECK-NEXT:     - Name:            a
19; CHECK-NEXT:       Size:            8
20; CHECK-NEXT:       Align:           8
21; CHECK-NEXT:       ValueKind:       GlobalBuffer
22; CHECK-NEXT:       ValueType:       F16
23; CHECK-NEXT:       AddrSpaceQual:   Global
24; CHECK-NEXT:     - Name:            b
25; CHECK-NEXT:       Size:            8
26; CHECK-NEXT:       Align:           8
27; CHECK-NEXT:       ValueKind:       GlobalBuffer
28; CHECK-NEXT:       ValueType:       F16
29; CHECK-NEXT:       AddrSpaceQual:   Global
30; CHECK-NEXT:   CodeProps:
31define amdgpu_kernel void @test0(
32    half addrspace(1)* %r,
33    half addrspace(1)* %a,
34    half addrspace(1)* %b) {
35entry:
36  %a.val = load half, half addrspace(1)* %a
37  %b.val = load half, half addrspace(1)* %b
38  %r.val = fadd half %a.val, %b.val
39  store half %r.val, half addrspace(1)* %r
40  ret void
41}
42
43; CHECK:      - Name:       test8
44; CHECK:        SymbolName: 'test8@kd'
45; CHECK:        Args:
46; CHECK-NEXT:     - Name:            r
47; CHECK-NEXT:       Size:            8
48; CHECK-NEXT:       Align:           8
49; CHECK-NEXT:       ValueKind:       GlobalBuffer
50; CHECK-NEXT:       ValueType:       F16
51; CHECK-NEXT:       AddrSpaceQual:   Global
52; CHECK-NEXT:     - Name:            a
53; CHECK-NEXT:       Size:            8
54; CHECK-NEXT:       Align:           8
55; CHECK-NEXT:       ValueKind:       GlobalBuffer
56; CHECK-NEXT:       ValueType:       F16
57; CHECK-NEXT:       AddrSpaceQual:   Global
58; CHECK-NEXT:     - Name:            b
59; CHECK-NEXT:       Size:            8
60; CHECK-NEXT:       Align:           8
61; CHECK-NEXT:       ValueKind:       GlobalBuffer
62; CHECK-NEXT:       ValueType:       F16
63; CHECK-NEXT:       AddrSpaceQual:   Global
64; CHECK-NEXT:     - Size:            8
65; CHECK-NEXT:       Align:           8
66; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetX
67; CHECK-NEXT:       ValueType:       I64
68; CHECK-NEXT:   CodeProps:
69define amdgpu_kernel void @test8(
70    half addrspace(1)* %r,
71    half addrspace(1)* %a,
72    half addrspace(1)* %b) #0 {
73entry:
74  %a.val = load half, half addrspace(1)* %a
75  %b.val = load half, half addrspace(1)* %b
76  %r.val = fadd half %a.val, %b.val
77  store half %r.val, half addrspace(1)* %r
78  ret void
79}
80
81; CHECK:      - Name:       test16
82; CHECK:        SymbolName: 'test16@kd'
83; CHECK:        Args:
84; CHECK-NEXT:     - Name:            r
85; CHECK-NEXT:       Size:            8
86; CHECK-NEXT:       Align:           8
87; CHECK-NEXT:       ValueKind:       GlobalBuffer
88; CHECK-NEXT:       ValueType:       F16
89; CHECK-NEXT:       AddrSpaceQual:   Global
90; CHECK-NEXT:     - Name:            a
91; CHECK-NEXT:       Size:            8
92; CHECK-NEXT:       Align:           8
93; CHECK-NEXT:       ValueKind:       GlobalBuffer
94; CHECK-NEXT:       ValueType:       F16
95; CHECK-NEXT:       AddrSpaceQual:   Global
96; CHECK-NEXT:     - Name:            b
97; CHECK-NEXT:       Size:            8
98; CHECK-NEXT:       Align:           8
99; CHECK-NEXT:       ValueKind:       GlobalBuffer
100; CHECK-NEXT:       ValueType:       F16
101; CHECK-NEXT:       AddrSpaceQual:   Global
102; CHECK-NEXT:     - Size:            8
103; CHECK-NEXT:       Align:           8
104; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetX
105; CHECK-NEXT:       ValueType:       I64
106; CHECK-NEXT:     - Size:            8
107; CHECK-NEXT:       Align:           8
108; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetY
109; CHECK-NEXT:       ValueType:       I64
110; CHECK-NEXT:   CodeProps:
111define amdgpu_kernel void @test16(
112    half addrspace(1)* %r,
113    half addrspace(1)* %a,
114    half addrspace(1)* %b) #1 {
115entry:
116  %a.val = load half, half addrspace(1)* %a
117  %b.val = load half, half addrspace(1)* %b
118  %r.val = fadd half %a.val, %b.val
119  store half %r.val, half addrspace(1)* %r
120  ret void
121}
122
123; CHECK:      - Name:       test24
124; CHECK:        SymbolName: 'test24@kd'
125; CHECK:        Args:
126; CHECK-NEXT:     - Name:            r
127; CHECK-NEXT:       Size:            8
128; CHECK-NEXT:       Align:           8
129; CHECK-NEXT:       ValueKind:       GlobalBuffer
130; CHECK-NEXT:       ValueType:       F16
131; CHECK-NEXT:       AddrSpaceQual:   Global
132; CHECK-NEXT:     - Name:            a
133; CHECK-NEXT:       Size:            8
134; CHECK-NEXT:       Align:           8
135; CHECK-NEXT:       ValueKind:       GlobalBuffer
136; CHECK-NEXT:       ValueType:       F16
137; CHECK-NEXT:       AddrSpaceQual:   Global
138; CHECK-NEXT:     - Name:            b
139; CHECK-NEXT:       Size:            8
140; CHECK-NEXT:       Align:           8
141; CHECK-NEXT:       ValueKind:       GlobalBuffer
142; CHECK-NEXT:       ValueType:       F16
143; CHECK-NEXT:       AddrSpaceQual:   Global
144; CHECK-NEXT:     - Size:            8
145; CHECK-NEXT:       Align:           8
146; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetX
147; CHECK-NEXT:       ValueType:       I64
148; CHECK-NEXT:     - Size:            8
149; CHECK-NEXT:       Align:           8
150; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetY
151; CHECK-NEXT:       ValueType:       I64
152; CHECK-NEXT:     - Size:            8
153; CHECK-NEXT:       Align:           8
154; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetZ
155; CHECK-NEXT:       ValueType:       I64
156; CHECK-NEXT:   CodeProps:
157define amdgpu_kernel void @test24(
158    half addrspace(1)* %r,
159    half addrspace(1)* %a,
160    half addrspace(1)* %b) #2 {
161entry:
162  %a.val = load half, half addrspace(1)* %a
163  %b.val = load half, half addrspace(1)* %b
164  %r.val = fadd half %a.val, %b.val
165  store half %r.val, half addrspace(1)* %r
166  ret void
167}
168
169; CHECK:      - Name:       test32
170; CHECK:        SymbolName: 'test32@kd'
171; CHECK:        Args:
172; CHECK-NEXT:     - Name:            r
173; CHECK-NEXT:       Size:            8
174; CHECK-NEXT:       Align:           8
175; CHECK-NEXT:       ValueKind:       GlobalBuffer
176; CHECK-NEXT:       ValueType:       F16
177; CHECK-NEXT:       AddrSpaceQual:   Global
178; CHECK-NEXT:     - Name:            a
179; CHECK-NEXT:       Size:            8
180; CHECK-NEXT:       Align:           8
181; CHECK-NEXT:       ValueKind:       GlobalBuffer
182; CHECK-NEXT:       ValueType:       F16
183; CHECK-NEXT:       AddrSpaceQual:   Global
184; CHECK-NEXT:     - Name:            b
185; CHECK-NEXT:       Size:            8
186; CHECK-NEXT:       Align:           8
187; CHECK-NEXT:       ValueKind:       GlobalBuffer
188; CHECK-NEXT:       ValueType:       F16
189; CHECK-NEXT:       AddrSpaceQual:   Global
190; CHECK-NEXT:     - Size:            8
191; CHECK-NEXT:       Align:           8
192; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetX
193; CHECK-NEXT:       ValueType:       I64
194; CHECK-NEXT:     - Size:            8
195; CHECK-NEXT:       Align:           8
196; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetY
197; CHECK-NEXT:       ValueType:       I64
198; CHECK-NEXT:     - Size:            8
199; CHECK-NEXT:       Align:           8
200; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetZ
201; CHECK-NEXT:       ValueType:       I64
202; CHECK-NEXT:     - Size:            8
203; CHECK-NEXT:       Align:           8
204; CHECK-NEXT:       ValueKind:       HiddenNone
205; CHECK-NEXT:       ValueType:       I8
206; CHECK-NEXT:       AddrSpaceQual:   Global
207; CHECK-NEXT:   CodeProps:
208define amdgpu_kernel void @test32(
209    half addrspace(1)* %r,
210    half addrspace(1)* %a,
211    half addrspace(1)* %b) #3 {
212entry:
213  %a.val = load half, half addrspace(1)* %a
214  %b.val = load half, half addrspace(1)* %b
215  %r.val = fadd half %a.val, %b.val
216  store half %r.val, half addrspace(1)* %r
217  ret void
218}
219
220; CHECK:      - Name:       test48
221; CHECK:        SymbolName: 'test48@kd'
222; CHECK:        Args:
223; CHECK-NEXT:     - Name:            r
224; CHECK-NEXT:       Size:            8
225; CHECK-NEXT:       Align:           8
226; CHECK-NEXT:       ValueKind:       GlobalBuffer
227; CHECK-NEXT:       ValueType:       F16
228; CHECK-NEXT:       AddrSpaceQual:   Global
229; CHECK-NEXT:     - Name:            a
230; CHECK-NEXT:       Size:            8
231; CHECK-NEXT:       Align:           8
232; CHECK-NEXT:       ValueKind:       GlobalBuffer
233; CHECK-NEXT:       ValueType:       F16
234; CHECK-NEXT:       AddrSpaceQual:   Global
235; CHECK-NEXT:     - Name:            b
236; CHECK-NEXT:       Size:            8
237; CHECK-NEXT:       Align:           8
238; CHECK-NEXT:       ValueKind:       GlobalBuffer
239; CHECK-NEXT:       ValueType:       F16
240; CHECK-NEXT:       AddrSpaceQual:   Global
241; CHECK-NEXT:     - Size:            8
242; CHECK-NEXT:       Align:           8
243; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetX
244; CHECK-NEXT:       ValueType:       I64
245; CHECK-NEXT:     - Size:            8
246; CHECK-NEXT:       Align:           8
247; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetY
248; CHECK-NEXT:       ValueType:       I64
249; CHECK-NEXT:     - Size:            8
250; CHECK-NEXT:       Align:           8
251; CHECK-NEXT:       ValueKind:       HiddenGlobalOffsetZ
252; CHECK-NEXT:       ValueType:       I64
253; CHECK-NEXT:     - Size:            8
254; CHECK-NEXT:       Align:           8
255; CHECK-NEXT:       ValueKind:       HiddenNone
256; CHECK-NEXT:       ValueType:       I8
257; CHECK-NEXT:       AddrSpaceQual:   Global
258; CHECK-NEXT:     - Size:            8
259; CHECK-NEXT:       Align:           8
260; CHECK-NEXT:       ValueKind:       HiddenNone
261; CHECK-NEXT:       ValueType:       I8
262; CHECK-NEXT:       AddrSpaceQual:   Global
263; CHECK-NEXT:     - Size:            8
264; CHECK-NEXT:       Align:           8
265; CHECK-NEXT:       ValueKind:       HiddenNone
266; CHECK-NEXT:       ValueType:       I8
267; CHECK-NEXT:       AddrSpaceQual:   Global
268; CHECK-NEXT:   CodeProps:
269define amdgpu_kernel void @test48(
270    half addrspace(1)* %r,
271    half addrspace(1)* %a,
272    half addrspace(1)* %b) #4 {
273entry:
274  %a.val = load half, half addrspace(1)* %a
275  %b.val = load half, half addrspace(1)* %b
276  %r.val = fadd half %a.val, %b.val
277  store half %r.val, half addrspace(1)* %r
278  ret void
279}
280
281attributes #0 = { "amdgpu-implicitarg-num-bytes"="8" }
282attributes #1 = { "amdgpu-implicitarg-num-bytes"="16" }
283attributes #2 = { "amdgpu-implicitarg-num-bytes"="24" }
284attributes #3 = { "amdgpu-implicitarg-num-bytes"="32" }
285attributes #4 = { "amdgpu-implicitarg-num-bytes"="48" }
286