1 ; RUN: not llc -mtriple=amdgcn -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=ERROR %s
3 ; ERROR: error: <unknown>:0:0: scalar registers (106) exceeds limit (104) in function 'use_too_many_sgprs_tahiti'
4 define amdgpu_kernel void @use_too_many_sgprs_tahiti() #0 {
5 call void asm sideeffect "", "~{s[0:7]}" ()
6 call void asm sideeffect "", "~{s[8:15]}" ()
7 call void asm sideeffect "", "~{s[16:23]}" ()
8 call void asm sideeffect "", "~{s[24:31]}" ()
9 call void asm sideeffect "", "~{s[32:39]}" ()
10 call void asm sideeffect "", "~{s[40:47]}" ()
11 call void asm sideeffect "", "~{s[48:55]}" ()
12 call void asm sideeffect "", "~{s[56:63]}" ()
13 call void asm sideeffect "", "~{s[64:71]}" ()
14 call void asm sideeffect "", "~{s[72:79]}" ()
15 call void asm sideeffect "", "~{s[80:87]}" ()
16 call void asm sideeffect "", "~{s[88:95]}" ()
17 call void asm sideeffect "", "~{s[96:103]}" ()
18 call void asm sideeffect "", "~{vcc}" ()
22 ; ERROR: error: <unknown>:0:0: scalar registers (106) exceeds limit (104) in function 'use_too_many_sgprs_bonaire'
23 define amdgpu_kernel void @use_too_many_sgprs_bonaire() #1 {
24 call void asm sideeffect "", "~{s[0:7]}" ()
25 call void asm sideeffect "", "~{s[8:15]}" ()
26 call void asm sideeffect "", "~{s[16:23]}" ()
27 call void asm sideeffect "", "~{s[24:31]}" ()
28 call void asm sideeffect "", "~{s[32:39]}" ()
29 call void asm sideeffect "", "~{s[40:47]}" ()
30 call void asm sideeffect "", "~{s[48:55]}" ()
31 call void asm sideeffect "", "~{s[56:63]}" ()
32 call void asm sideeffect "", "~{s[64:71]}" ()
33 call void asm sideeffect "", "~{s[72:79]}" ()
34 call void asm sideeffect "", "~{s[80:87]}" ()
35 call void asm sideeffect "", "~{s[88:95]}" ()
36 call void asm sideeffect "", "~{s[96:103]}" ()
37 call void asm sideeffect "", "~{vcc}" ()
41 ; ERROR: error: <unknown>:0:0: scalar registers (108) exceeds limit (104) in function 'use_too_many_sgprs_bonaire_flat_scr'
42 define amdgpu_kernel void @use_too_many_sgprs_bonaire_flat_scr() #1 {
43 call void asm sideeffect "", "~{s[0:7]}" ()
44 call void asm sideeffect "", "~{s[8:15]}" ()
45 call void asm sideeffect "", "~{s[16:23]}" ()
46 call void asm sideeffect "", "~{s[24:31]}" ()
47 call void asm sideeffect "", "~{s[32:39]}" ()
48 call void asm sideeffect "", "~{s[40:47]}" ()
49 call void asm sideeffect "", "~{s[48:55]}" ()
50 call void asm sideeffect "", "~{s[56:63]}" ()
51 call void asm sideeffect "", "~{s[64:71]}" ()
52 call void asm sideeffect "", "~{s[72:79]}" ()
53 call void asm sideeffect "", "~{s[80:87]}" ()
54 call void asm sideeffect "", "~{s[88:95]}" ()
55 call void asm sideeffect "", "~{s[96:103]}" ()
56 call void asm sideeffect "", "~{vcc}" ()
57 call void asm sideeffect "", "~{flat_scratch}" ()
61 ; ERROR: error: <unknown>:0:0: scalar registers (98) exceeds limit (96) in function 'use_too_many_sgprs_iceland'
62 define amdgpu_kernel void @use_too_many_sgprs_iceland() #2 {
63 call void asm sideeffect "", "~{vcc}" ()
64 call void asm sideeffect "", "~{s[0:7]}" ()
65 call void asm sideeffect "", "~{s[8:15]}" ()
66 call void asm sideeffect "", "~{s[16:23]}" ()
67 call void asm sideeffect "", "~{s[24:31]}" ()
68 call void asm sideeffect "", "~{s[32:39]}" ()
69 call void asm sideeffect "", "~{s[40:47]}" ()
70 call void asm sideeffect "", "~{s[48:55]}" ()
71 call void asm sideeffect "", "~{s[56:63]}" ()
72 call void asm sideeffect "", "~{s[64:71]}" ()
73 call void asm sideeffect "", "~{s[72:79]}" ()
74 call void asm sideeffect "", "~{s[80:87]}" ()
75 call void asm sideeffect "", "~{s[88:95]}" ()
79 ; ERROR: error: <unknown>:0:0: addressable scalar registers (103) exceeds limit (102) in function 'use_too_many_sgprs_fiji'
80 define amdgpu_kernel void @use_too_many_sgprs_fiji() #3 {
81 call void asm sideeffect "", "~{s[0:7]}" ()
82 call void asm sideeffect "", "~{s[8:15]}" ()
83 call void asm sideeffect "", "~{s[16:23]}" ()
84 call void asm sideeffect "", "~{s[24:31]}" ()
85 call void asm sideeffect "", "~{s[32:39]}" ()
86 call void asm sideeffect "", "~{s[40:47]}" ()
87 call void asm sideeffect "", "~{s[48:55]}" ()
88 call void asm sideeffect "", "~{s[56:63]}" ()
89 call void asm sideeffect "", "~{s[64:71]}" ()
90 call void asm sideeffect "", "~{s[72:79]}" ()
91 call void asm sideeffect "", "~{s[80:87]}" ()
92 call void asm sideeffect "", "~{s[88:95]}" ()
93 call void asm sideeffect "", "~{s[96:99]}" ()
94 call void asm sideeffect "", "~{s[100:101]}" ()
95 call void asm sideeffect "", "~{s102}" ()
99 attributes #0 = { nounwind "target-cpu"="tahiti" }
100 attributes #1 = { nounwind "target-cpu"="bonaire" }
101 attributes #2 = { nounwind "target-cpu"="iceland" }
102 attributes #3 = { nounwind "target-cpu"="fiji" }