1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -enable-misched=0 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefixes=CHECK,GFX700,WAVE64 %s
2 ; RUN: llc -mattr=-xnack -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -enable-misched=0 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefixes=CHECK,GFX803,WAVE64 %s
3 ; RUN: llc -mattr=-xnack -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -enable-misched=0 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefixes=CHECK,GFX900,WAVE64 %s
4 ; RUN: llc -mattr=-xnack -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -enable-misched=0 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefixes=CHECK,GFX1010,WAVE32 %s
6 @var = addrspace(1) global float 0.0
9 ; CHECK: amdhsa.kernels:
12 ; CHECK: .group_segment_fixed_size: 0
13 ; CHECK: .kernarg_segment_align: 8
14 ; CHECK: .kernarg_segment_size: 24
15 ; CHECK: .max_flat_workgroup_size: 1024
17 ; CHECK: .private_segment_fixed_size: 0
18 ; CHECK: .sgpr_count: 6
19 ; CHECK: .symbol: test.kd
20 ; CHECK: .vgpr_count: {{3|6}}
21 ; WAVE64: .wavefront_size: 64
22 ; WAVE32: .wavefront_size: 32
23 define amdgpu_kernel void @test(
26 ptr addrspace(1) %b) {
28 %a.val = load half, ptr addrspace(1) %a
29 %b.val = load half, ptr addrspace(1) %b
30 %r.val = fadd half %a.val, %b.val
31 store half %r.val, ptr addrspace(1) %r
36 ; CHECK: .max_flat_workgroup_size: 256
37 define amdgpu_kernel void @test_max_flat_workgroup_size(
40 ptr addrspace(1) %b) #2 {
42 %a.val = load half, ptr addrspace(1) %a
43 %b.val = load half, ptr addrspace(1) %b
44 %r.val = fadd half %a.val, %b.val
45 store half %r.val, ptr addrspace(1) %r
49 ; CHECK: .name: num_spilled_sgprs
50 ; GFX700: .sgpr_spill_count: 12
51 ; GFX803: .sgpr_spill_count: 12
52 ; GFX900: .sgpr_spill_count: 48
53 ; GFX1010: .sgpr_spill_count: 48
54 ; CHECK: .symbol: num_spilled_sgprs.kd
55 define amdgpu_kernel void @num_spilled_sgprs(
56 ptr addrspace(1) %out0, ptr addrspace(1) %out1, [8 x i32],
57 ptr addrspace(1) %out2, ptr addrspace(1) %out3, [8 x i32],
58 ptr addrspace(1) %out4, ptr addrspace(1) %out5, [8 x i32],
59 ptr addrspace(1) %out6, ptr addrspace(1) %out7, [8 x i32],
60 ptr addrspace(1) %out8, ptr addrspace(1) %out9, [8 x i32],
61 ptr addrspace(1) %outa, ptr addrspace(1) %outb, [8 x i32],
62 ptr addrspace(1) %outc, ptr addrspace(1) %outd, [8 x i32],
63 ptr addrspace(1) %oute, ptr addrspace(1) %outf, [8 x i32],
64 i32 %in0, i32 %in1, i32 %in2, i32 %in3, [8 x i32],
65 i32 %in4, i32 %in5, i32 %in6, i32 %in7, [8 x i32],
66 i32 %in8, i32 %in9, i32 %ina, i32 %inb, [8 x i32],
67 i32 %inc, i32 %ind, i32 %ine, i32 %inf) #0 {
69 store i32 %in0, ptr addrspace(1) %out0
70 store i32 %in1, ptr addrspace(1) %out1
71 store i32 %in2, ptr addrspace(1) %out2
72 store i32 %in3, ptr addrspace(1) %out3
73 store i32 %in4, ptr addrspace(1) %out4
74 store i32 %in5, ptr addrspace(1) %out5
75 store i32 %in6, ptr addrspace(1) %out6
76 store i32 %in7, ptr addrspace(1) %out7
77 store i32 %in8, ptr addrspace(1) %out8
78 store i32 %in9, ptr addrspace(1) %out9
79 store i32 %ina, ptr addrspace(1) %outa
80 store i32 %inb, ptr addrspace(1) %outb
81 store i32 %inc, ptr addrspace(1) %outc
82 store i32 %ind, ptr addrspace(1) %outd
83 store i32 %ine, ptr addrspace(1) %oute
84 store i32 %inf, ptr addrspace(1) %outf
88 ; CHECK: .name: num_spilled_vgprs
89 ; CHECK: .symbol: num_spilled_vgprs.kd
90 ; CHECK: .vgpr_spill_count: {{13|14}}
91 define amdgpu_kernel void @num_spilled_vgprs() #1 {
92 %val0 = load volatile float, ptr addrspace(1) @var
93 %val1 = load volatile float, ptr addrspace(1) @var
94 %val2 = load volatile float, ptr addrspace(1) @var
95 %val3 = load volatile float, ptr addrspace(1) @var
96 %val4 = load volatile float, ptr addrspace(1) @var
97 %val5 = load volatile float, ptr addrspace(1) @var
98 %val6 = load volatile float, ptr addrspace(1) @var
99 %val7 = load volatile float, ptr addrspace(1) @var
100 %val8 = load volatile float, ptr addrspace(1) @var
101 %val9 = load volatile float, ptr addrspace(1) @var
102 %val10 = load volatile float, ptr addrspace(1) @var
103 %val11 = load volatile float, ptr addrspace(1) @var
104 %val12 = load volatile float, ptr addrspace(1) @var
105 %val13 = load volatile float, ptr addrspace(1) @var
106 %val14 = load volatile float, ptr addrspace(1) @var
107 %val15 = load volatile float, ptr addrspace(1) @var
108 %val16 = load volatile float, ptr addrspace(1) @var
109 %val17 = load volatile float, ptr addrspace(1) @var
110 %val18 = load volatile float, ptr addrspace(1) @var
111 %val19 = load volatile float, ptr addrspace(1) @var
112 %val20 = load volatile float, ptr addrspace(1) @var
113 %val21 = load volatile float, ptr addrspace(1) @var
114 %val22 = load volatile float, ptr addrspace(1) @var
115 %val23 = load volatile float, ptr addrspace(1) @var
116 %val24 = load volatile float, ptr addrspace(1) @var
117 %val25 = load volatile float, ptr addrspace(1) @var
118 %val26 = load volatile float, ptr addrspace(1) @var
119 %val27 = load volatile float, ptr addrspace(1) @var
120 %val28 = load volatile float, ptr addrspace(1) @var
121 %val29 = load volatile float, ptr addrspace(1) @var
122 %val30 = load volatile float, ptr addrspace(1) @var
124 store volatile float %val0, ptr addrspace(1) @var
125 store volatile float %val1, ptr addrspace(1) @var
126 store volatile float %val2, ptr addrspace(1) @var
127 store volatile float %val3, ptr addrspace(1) @var
128 store volatile float %val4, ptr addrspace(1) @var
129 store volatile float %val5, ptr addrspace(1) @var
130 store volatile float %val6, ptr addrspace(1) @var
131 store volatile float %val7, ptr addrspace(1) @var
132 store volatile float %val8, ptr addrspace(1) @var
133 store volatile float %val9, ptr addrspace(1) @var
134 store volatile float %val10, ptr addrspace(1) @var
135 store volatile float %val11, ptr addrspace(1) @var
136 store volatile float %val12, ptr addrspace(1) @var
137 store volatile float %val13, ptr addrspace(1) @var
138 store volatile float %val14, ptr addrspace(1) @var
139 store volatile float %val15, ptr addrspace(1) @var
140 store volatile float %val16, ptr addrspace(1) @var
141 store volatile float %val17, ptr addrspace(1) @var
142 store volatile float %val18, ptr addrspace(1) @var
143 store volatile float %val19, ptr addrspace(1) @var
144 store volatile float %val20, ptr addrspace(1) @var
145 store volatile float %val21, ptr addrspace(1) @var
146 store volatile float %val22, ptr addrspace(1) @var
147 store volatile float %val23, ptr addrspace(1) @var
148 store volatile float %val24, ptr addrspace(1) @var
149 store volatile float %val25, ptr addrspace(1) @var
150 store volatile float %val26, ptr addrspace(1) @var
151 store volatile float %val27, ptr addrspace(1) @var
152 store volatile float %val28, ptr addrspace(1) @var
153 store volatile float %val29, ptr addrspace(1) @var
154 store volatile float %val30, ptr addrspace(1) @var
159 ; CHECK: amdhsa.version:
163 attributes #0 = { "amdgpu-num-sgpr"="14" }
164 attributes #1 = { "amdgpu-num-vgpr"="20" }
165 attributes #2 = { "amdgpu-flat-work-group-size"="1,256" }
167 !llvm.module.flags = !{!0}
168 !0 = !{i32 1, !"amdgpu_code_object_version", i32 300}