• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc -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=NOTES %s
2; RUN: llc -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=NOTES %s
3; RUN: llc -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=NOTES %s
4
5@var = addrspace(1) global float 0.0
6
7; CHECK: ---
8; CHECK:  Version: [ 1, 0 ]
9; CHECK:  Kernels:
10
11; CHECK-LABEL: - Name:       test
12; CHECK:   SymbolName: 'test@kd'
13; CHECK:   CodeProps:
14; CHECK:     KernargSegmentSize:      24
15; CHECK:     GroupSegmentFixedSize:   0
16; CHECK:     PrivateSegmentFixedSize: 0
17; CHECK:     KernargSegmentAlign:     8
18; CHECK:     WavefrontSize:           64
19; CHECK:     NumSGPRs:                8
20; CHECK:     NumVGPRs:                6
21; CHECK:     MaxFlatWorkGroupSize:    256
22define amdgpu_kernel void @test(
23    half addrspace(1)* %r,
24    half addrspace(1)* %a,
25    half addrspace(1)* %b) {
26entry:
27  %a.val = load half, half addrspace(1)* %a
28  %b.val = load half, half addrspace(1)* %b
29  %r.val = fadd half %a.val, %b.val
30  store half %r.val, half addrspace(1)* %r
31  ret void
32}
33
34; CHECK-LABEL: - Name:       num_spilled_sgprs
35; CHECK:   SymbolName: 'num_spilled_sgprs@kd'
36; CHECK:   CodeProps:
37; GFX700:     NumSpilledSGPRs: 40
38; GFX803:     NumSpilledSGPRs: 24
39; GFX900:     NumSpilledSGPRs: 24
40define amdgpu_kernel void @num_spilled_sgprs(
41    i32 addrspace(1)* %out0, i32 addrspace(1)* %out1, [8 x i32],
42    i32 addrspace(1)* %out2, i32 addrspace(1)* %out3, [8 x i32],
43    i32 addrspace(1)* %out4, i32 addrspace(1)* %out5, [8 x i32],
44    i32 addrspace(1)* %out6, i32 addrspace(1)* %out7, [8 x i32],
45    i32 addrspace(1)* %out8, i32 addrspace(1)* %out9, [8 x i32],
46    i32 addrspace(1)* %outa, i32 addrspace(1)* %outb, [8 x i32],
47    i32 addrspace(1)* %outc, i32 addrspace(1)* %outd, [8 x i32],
48    i32 addrspace(1)* %oute, i32 addrspace(1)* %outf, [8 x i32],
49    i32 %in0, i32 %in1, i32 %in2, i32 %in3, [8 x i32],
50    i32 %in4, i32 %in5, i32 %in6, i32 %in7, [8 x i32],
51    i32 %in8, i32 %in9, i32 %ina, i32 %inb, [8 x i32],
52    i32 %inc, i32 %ind, i32 %ine, i32 %inf) #0 {
53entry:
54  store i32 %in0, i32 addrspace(1)* %out0
55  store i32 %in1, i32 addrspace(1)* %out1
56  store i32 %in2, i32 addrspace(1)* %out2
57  store i32 %in3, i32 addrspace(1)* %out3
58  store i32 %in4, i32 addrspace(1)* %out4
59  store i32 %in5, i32 addrspace(1)* %out5
60  store i32 %in6, i32 addrspace(1)* %out6
61  store i32 %in7, i32 addrspace(1)* %out7
62  store i32 %in8, i32 addrspace(1)* %out8
63  store i32 %in9, i32 addrspace(1)* %out9
64  store i32 %ina, i32 addrspace(1)* %outa
65  store i32 %inb, i32 addrspace(1)* %outb
66  store i32 %inc, i32 addrspace(1)* %outc
67  store i32 %ind, i32 addrspace(1)* %outd
68  store i32 %ine, i32 addrspace(1)* %oute
69  store i32 %inf, i32 addrspace(1)* %outf
70  ret void
71}
72
73; CHECK-LABEL: - Name:       num_spilled_vgprs
74; CHECK:   SymbolName: 'num_spilled_vgprs@kd'
75; CHECK:   CodeProps:
76; CHECK:     NumSpilledVGPRs: 14
77define amdgpu_kernel void @num_spilled_vgprs() #1 {
78  %val0 = load volatile float, float addrspace(1)* @var
79  %val1 = load volatile float, float addrspace(1)* @var
80  %val2 = load volatile float, float addrspace(1)* @var
81  %val3 = load volatile float, float addrspace(1)* @var
82  %val4 = load volatile float, float addrspace(1)* @var
83  %val5 = load volatile float, float addrspace(1)* @var
84  %val6 = load volatile float, float addrspace(1)* @var
85  %val7 = load volatile float, float addrspace(1)* @var
86  %val8 = load volatile float, float addrspace(1)* @var
87  %val9 = load volatile float, float addrspace(1)* @var
88  %val10 = load volatile float, float addrspace(1)* @var
89  %val11 = load volatile float, float addrspace(1)* @var
90  %val12 = load volatile float, float addrspace(1)* @var
91  %val13 = load volatile float, float addrspace(1)* @var
92  %val14 = load volatile float, float addrspace(1)* @var
93  %val15 = load volatile float, float addrspace(1)* @var
94  %val16 = load volatile float, float addrspace(1)* @var
95  %val17 = load volatile float, float addrspace(1)* @var
96  %val18 = load volatile float, float addrspace(1)* @var
97  %val19 = load volatile float, float addrspace(1)* @var
98  %val20 = load volatile float, float addrspace(1)* @var
99  %val21 = load volatile float, float addrspace(1)* @var
100  %val22 = load volatile float, float addrspace(1)* @var
101  %val23 = load volatile float, float addrspace(1)* @var
102  %val24 = load volatile float, float addrspace(1)* @var
103  %val25 = load volatile float, float addrspace(1)* @var
104  %val26 = load volatile float, float addrspace(1)* @var
105  %val27 = load volatile float, float addrspace(1)* @var
106  %val28 = load volatile float, float addrspace(1)* @var
107  %val29 = load volatile float, float addrspace(1)* @var
108  %val30 = load volatile float, float addrspace(1)* @var
109
110  store volatile float %val0, float addrspace(1)* @var
111  store volatile float %val1, float addrspace(1)* @var
112  store volatile float %val2, float addrspace(1)* @var
113  store volatile float %val3, float addrspace(1)* @var
114  store volatile float %val4, float addrspace(1)* @var
115  store volatile float %val5, float addrspace(1)* @var
116  store volatile float %val6, float addrspace(1)* @var
117  store volatile float %val7, float addrspace(1)* @var
118  store volatile float %val8, float addrspace(1)* @var
119  store volatile float %val9, float addrspace(1)* @var
120  store volatile float %val10, float addrspace(1)* @var
121  store volatile float %val11, float addrspace(1)* @var
122  store volatile float %val12, float addrspace(1)* @var
123  store volatile float %val13, float addrspace(1)* @var
124  store volatile float %val14, float addrspace(1)* @var
125  store volatile float %val15, float addrspace(1)* @var
126  store volatile float %val16, float addrspace(1)* @var
127  store volatile float %val17, float addrspace(1)* @var
128  store volatile float %val18, float addrspace(1)* @var
129  store volatile float %val19, float addrspace(1)* @var
130  store volatile float %val20, float addrspace(1)* @var
131  store volatile float %val21, float addrspace(1)* @var
132  store volatile float %val22, float addrspace(1)* @var
133  store volatile float %val23, float addrspace(1)* @var
134  store volatile float %val24, float addrspace(1)* @var
135  store volatile float %val25, float addrspace(1)* @var
136  store volatile float %val26, float addrspace(1)* @var
137  store volatile float %val27, float addrspace(1)* @var
138  store volatile float %val28, float addrspace(1)* @var
139  store volatile float %val29, float addrspace(1)* @var
140  store volatile float %val30, float addrspace(1)* @var
141
142  ret void
143}
144
145attributes #0 = { "amdgpu-num-sgpr"="14" }
146attributes #1 = { "amdgpu-num-vgpr"="20" }
147