1 ; RUN: llc -mattr=+code-object-v3 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -enable-misched=0 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=WAVE64 --check-prefix=NOTES %s
2 ; RUN: llc -mattr=+code-object-v3 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx803 -enable-misched=0 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX803 --check-prefix=WAVE64 --check-prefix=NOTES %s
3 ; RUN: llc -mattr=+code-object-v3 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -enable-misched=0 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=WAVE64 --check-prefix=NOTES %s
4 ; RUN: llc -mattr=+code-object-v3 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1010 -enable-misched=0 -filetype=obj -o - < %s | llvm-readobj -elf-output-style=GNU -notes | FileCheck --check-prefix=CHECK --check-prefix=GFX1010 --check-prefix=WAVE32 --check-prefix=NOTES %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: 256
17 ; CHECK: .private_segment_fixed_size: 0
18 ; WAVE64: .sgpr_count: 8
19 ; WAVE32: .sgpr_count: 10
20 ; CHECK: .symbol: test.kd
21 ; CHECK: .vgpr_count: 6
22 ; WAVE64: .wavefront_size: 64
23 ; WAVE32: .wavefront_size: 32
24 define amdgpu_kernel void @test(
25 half addrspace(1)* %r,
26 half addrspace(1)* %a,
27 half addrspace(1)* %b) {
29 %a.val = load half, half addrspace(1)* %a
30 %b.val = load half, half addrspace(1)* %b
31 %r.val = fadd half %a.val, %b.val
32 store half %r.val, half addrspace(1)* %r
36 ; CHECK: .name: num_spilled_sgprs
37 ; GFX700: .sgpr_spill_count: 40
38 ; GFX803: .sgpr_spill_count: 24
39 ; GFX900: .sgpr_spill_count: 24
40 ; GFX1010: .sgpr_spill_count: 24
41 ; CHECK: .symbol: num_spilled_sgprs.kd
42 define amdgpu_kernel void @num_spilled_sgprs(
43 i32 addrspace(1)* %out0, i32 addrspace(1)* %out1, [8 x i32],
44 i32 addrspace(1)* %out2, i32 addrspace(1)* %out3, [8 x i32],
45 i32 addrspace(1)* %out4, i32 addrspace(1)* %out5, [8 x i32],
46 i32 addrspace(1)* %out6, i32 addrspace(1)* %out7, [8 x i32],
47 i32 addrspace(1)* %out8, i32 addrspace(1)* %out9, [8 x i32],
48 i32 addrspace(1)* %outa, i32 addrspace(1)* %outb, [8 x i32],
49 i32 addrspace(1)* %outc, i32 addrspace(1)* %outd, [8 x i32],
50 i32 addrspace(1)* %oute, i32 addrspace(1)* %outf, [8 x i32],
51 i32 %in0, i32 %in1, i32 %in2, i32 %in3, [8 x i32],
52 i32 %in4, i32 %in5, i32 %in6, i32 %in7, [8 x i32],
53 i32 %in8, i32 %in9, i32 %ina, i32 %inb, [8 x i32],
54 i32 %inc, i32 %ind, i32 %ine, i32 %inf) #0 {
56 store i32 %in0, i32 addrspace(1)* %out0
57 store i32 %in1, i32 addrspace(1)* %out1
58 store i32 %in2, i32 addrspace(1)* %out2
59 store i32 %in3, i32 addrspace(1)* %out3
60 store i32 %in4, i32 addrspace(1)* %out4
61 store i32 %in5, i32 addrspace(1)* %out5
62 store i32 %in6, i32 addrspace(1)* %out6
63 store i32 %in7, i32 addrspace(1)* %out7
64 store i32 %in8, i32 addrspace(1)* %out8
65 store i32 %in9, i32 addrspace(1)* %out9
66 store i32 %ina, i32 addrspace(1)* %outa
67 store i32 %inb, i32 addrspace(1)* %outb
68 store i32 %inc, i32 addrspace(1)* %outc
69 store i32 %ind, i32 addrspace(1)* %outd
70 store i32 %ine, i32 addrspace(1)* %oute
71 store i32 %inf, i32 addrspace(1)* %outf
75 ; CHECK: .name: num_spilled_vgprs
76 ; CHECK: .symbol: num_spilled_vgprs.kd
77 ; CHECK: .vgpr_spill_count: 14
78 define amdgpu_kernel void @num_spilled_vgprs() #1 {
79 %val0 = load volatile float, float addrspace(1)* @var
80 %val1 = load volatile float, float addrspace(1)* @var
81 %val2 = load volatile float, float addrspace(1)* @var
82 %val3 = load volatile float, float addrspace(1)* @var
83 %val4 = load volatile float, float addrspace(1)* @var
84 %val5 = load volatile float, float addrspace(1)* @var
85 %val6 = load volatile float, float addrspace(1)* @var
86 %val7 = load volatile float, float addrspace(1)* @var
87 %val8 = load volatile float, float addrspace(1)* @var
88 %val9 = load volatile float, float addrspace(1)* @var
89 %val10 = load volatile float, float addrspace(1)* @var
90 %val11 = load volatile float, float addrspace(1)* @var
91 %val12 = load volatile float, float addrspace(1)* @var
92 %val13 = load volatile float, float addrspace(1)* @var
93 %val14 = load volatile float, float addrspace(1)* @var
94 %val15 = load volatile float, float addrspace(1)* @var
95 %val16 = load volatile float, float addrspace(1)* @var
96 %val17 = load volatile float, float addrspace(1)* @var
97 %val18 = load volatile float, float addrspace(1)* @var
98 %val19 = load volatile float, float addrspace(1)* @var
99 %val20 = load volatile float, float addrspace(1)* @var
100 %val21 = load volatile float, float addrspace(1)* @var
101 %val22 = load volatile float, float addrspace(1)* @var
102 %val23 = load volatile float, float addrspace(1)* @var
103 %val24 = load volatile float, float addrspace(1)* @var
104 %val25 = load volatile float, float addrspace(1)* @var
105 %val26 = load volatile float, float addrspace(1)* @var
106 %val27 = load volatile float, float addrspace(1)* @var
107 %val28 = load volatile float, float addrspace(1)* @var
108 %val29 = load volatile float, float addrspace(1)* @var
109 %val30 = load volatile float, float addrspace(1)* @var
111 store volatile float %val0, float addrspace(1)* @var
112 store volatile float %val1, float addrspace(1)* @var
113 store volatile float %val2, float addrspace(1)* @var
114 store volatile float %val3, float addrspace(1)* @var
115 store volatile float %val4, float addrspace(1)* @var
116 store volatile float %val5, float addrspace(1)* @var
117 store volatile float %val6, float addrspace(1)* @var
118 store volatile float %val7, float addrspace(1)* @var
119 store volatile float %val8, float addrspace(1)* @var
120 store volatile float %val9, float addrspace(1)* @var
121 store volatile float %val10, float addrspace(1)* @var
122 store volatile float %val11, float addrspace(1)* @var
123 store volatile float %val12, float addrspace(1)* @var
124 store volatile float %val13, float addrspace(1)* @var
125 store volatile float %val14, float addrspace(1)* @var
126 store volatile float %val15, float addrspace(1)* @var
127 store volatile float %val16, float addrspace(1)* @var
128 store volatile float %val17, float addrspace(1)* @var
129 store volatile float %val18, float addrspace(1)* @var
130 store volatile float %val19, float addrspace(1)* @var
131 store volatile float %val20, float addrspace(1)* @var
132 store volatile float %val21, float addrspace(1)* @var
133 store volatile float %val22, float addrspace(1)* @var
134 store volatile float %val23, float addrspace(1)* @var
135 store volatile float %val24, float addrspace(1)* @var
136 store volatile float %val25, float addrspace(1)* @var
137 store volatile float %val26, float addrspace(1)* @var
138 store volatile float %val27, float addrspace(1)* @var
139 store volatile float %val28, float addrspace(1)* @var
140 store volatile float %val29, float addrspace(1)* @var
141 store volatile float %val30, float addrspace(1)* @var
146 ; CHECK: amdhsa.version:
150 attributes #0 = { "amdgpu-num-sgpr"="14" }
151 attributes #1 = { "amdgpu-num-vgpr"="20" }