aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/R600/cf-stack-bug.ll
blob: 02c87d76bb20983c4c765f6dfcdb323a0685bdc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
; RUN: llc -march=r600 -mcpu=redwood -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=BUG64 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=sumo -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=BUG64 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=barts -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=BUG64 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=turks -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=BUG64 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=caicos -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=BUG64 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=cedar -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=BUG32 --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=juniper -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=NOBUG --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=cypress -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=NOBUG --check-prefix=FUNC
; RUN: llc -march=r600 -mcpu=cayman -debug-only=r600cf %s -o - 2>&1 | FileCheck %s --check-prefix=NOBUG --check-prefix=FUNC

; REQUIRES: asserts

; We are currently allocating 2 extra sub-entries on Evergreen / NI for
; non-WQM push instructions if we change this to 1, then we will need to
; add one level of depth to each of these tests.

; BUG64-NOT: Applying bug work-around
; BUG32-NOT: Applying bug work-around
; NOBUG-NOT: Applying bug work-around
; FUNC-LABEL: {{^}}nested3:
define void @nested3(i32 addrspace(1)* %out, i32 %cond) {
entry:
  %0 = icmp sgt i32 %cond, 0
  br i1 %0, label %if.1, label %end

if.1:
  %1 = icmp sgt i32 %cond, 10
  br i1 %1, label %if.2, label %if.store.1

if.store.1:
  store i32 1, i32 addrspace(1)* %out
  br label %end

if.2:
  %2 = icmp sgt i32 %cond, 20
  br i1 %2, label %if.3, label %if.2.store

if.2.store:
  store i32 2, i32 addrspace(1)* %out
  br label %end

if.3:
  store i32 3, i32 addrspace(1)* %out
  br label %end

end:
  ret void
}

; BUG64: Applying bug work-around
; BUG32-NOT: Applying bug work-around
; NOBUG-NOT: Applying bug work-around
; FUNC-LABEL: {{^}}nested4:
define void @nested4(i32 addrspace(1)* %out, i32 %cond) {
entry:
  %0 = icmp sgt i32 %cond, 0
  br i1 %0, label %if.1, label %end

if.1:
  %1 = icmp sgt i32 %cond, 10
  br i1 %1, label %if.2, label %if.1.store

if.1.store:
  store i32 1, i32 addrspace(1)* %out
  br label %end

if.2:
  %2 = icmp sgt i32 %cond, 20
  br i1 %2, label %if.3, label %if.2.store

if.2.store:
  store i32 2, i32 addrspace(1)* %out
  br label %end

if.3:
  %3 = icmp sgt i32 %cond, 30
  br i1 %3, label %if.4, label %if.3.store

if.3.store:
  store i32 3, i32 addrspace(1)* %out
  br label %end

if.4:
  store i32 4, i32 addrspace(1)* %out
  br label %end

end:
  ret void
}

; BUG64: Applying bug work-around
; BUG32-NOT: Applying bug work-around
; NOBUG-NOT: Applying bug work-around
; FUNC-LABEL: {{^}}nested7:
define void @nested7(i32 addrspace(1)* %out, i32 %cond) {
entry:
  %0 = icmp sgt i32 %cond, 0
  br i1 %0, label %if.1, label %end

if.1:
  %1 = icmp sgt i32 %cond, 10
  br i1 %1, label %if.2, label %if.1.store

if.1.store:
  store i32 1, i32 addrspace(1)* %out
  br label %end

if.2:
  %2 = icmp sgt i32 %cond, 20
  br i1 %2, label %if.3, label %if.2.store

if.2.store:
  store i32 2, i32 addrspace(1)* %out
  br label %end

if.3:
  %3 = icmp sgt i32 %cond, 30
  br i1 %3, label %if.4, label %if.3.store

if.3.store:
  store i32 3, i32 addrspace(1)* %out
  br label %end

if.4:
  %4 = icmp sgt i32 %cond, 40
  br i1 %4, label %if.5, label %if.4.store

if.4.store:
  store i32 4, i32 addrspace(1)* %out
  br label %end

if.5:
  %5 = icmp sgt i32 %cond, 50
  br i1 %5, label %if.6, label %if.5.store

if.5.store:
  store i32 5, i32 addrspace(1)* %out
  br label %end

if.6:
  %6 = icmp sgt i32 %cond, 60
  br i1 %6, label %if.7, label %if.6.store

if.6.store:
  store i32 6, i32 addrspace(1)* %out
  br label %end

if.7:
  store i32 7, i32 addrspace(1)* %out
  br label %end

end:
  ret void
}

; BUG64: Applying bug work-around
; BUG32: Applying bug work-around
; NOBUG-NOT: Applying bug work-around
; FUNC-LABEL: {{^}}nested8:
define void @nested8(i32 addrspace(1)* %out, i32 %cond) {
entry:
  %0 = icmp sgt i32 %cond, 0
  br i1 %0, label %if.1, label %end

if.1:
  %1 = icmp sgt i32 %cond, 10
  br i1 %1, label %if.2, label %if.1.store

if.1.store:
  store i32 1, i32 addrspace(1)* %out
  br label %end

if.2:
  %2 = icmp sgt i32 %cond, 20
  br i1 %2, label %if.3, label %if.2.store

if.2.store:
  store i32 2, i32 addrspace(1)* %out
  br label %end

if.3:
  %3 = icmp sgt i32 %cond, 30
  br i1 %3, label %if.4, label %if.3.store

if.3.store:
  store i32 3, i32 addrspace(1)* %out
  br label %end

if.4:
  %4 = icmp sgt i32 %cond, 40
  br i1 %4, label %if.5, label %if.4.store

if.4.store:
  store i32 4, i32 addrspace(1)* %out
  br label %end

if.5:
  %5 = icmp sgt i32 %cond, 50
  br i1 %5, label %if.6, label %if.5.store

if.5.store:
  store i32 5, i32 addrspace(1)* %out
  br label %end

if.6:
  %6 = icmp sgt i32 %cond, 60
  br i1 %6, label %if.7, label %if.6.store

if.6.store:
  store i32 6, i32 addrspace(1)* %out
  br label %end

if.7:
  %7 = icmp sgt i32 %cond, 70
  br i1 %7, label %if.8, label %if.7.store

if.7.store:
  store i32 7, i32 addrspace(1)* %out
  br label %end

if.8:
  store i32 8, i32 addrspace(1)* %out
  br label %end

end:
  ret void
}