[RegAllocGreedy][Last Chance Recoloring] Emit diagnostics when last chance
[oota-llvm.git] / test / CodeGen / X86 / ragreedy-last-chance-recoloring.ll
1 ; RUN: llc -regalloc=greedy -relocation-model=pic  < %s 2>&1 | FileCheck %s
2 ; Without the last chance recoloring, this test fails with:
3 ; "ran out of registers".
4
5 ; RUN: not llc -regalloc=greedy -relocation-model=pic -lcr-max-depth=0  < %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEPTH
6 ; Test whether failure due to cutoff for depth is reported
7
8 ; RUN: not llc -regalloc=greedy -relocation-model=pic -lcr-max-interf=1  < %s 2>&1 | FileCheck %s --check-prefix=CHECK-INTERF
9 ; Test whether failure due to cutoff for interference is reported
10
11 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32-S128"
12 target triple = "i386-apple-macosx"
13
14 @fp_dh_36985b17790d59a27994eaab5dcb00ee = external constant [499 x i32]
15 @fp_dh_18716afa4a5354de0a302c8edb3b0ee1 = external global i32
16 @fp_dh_20a33cdeefab8f4c8887e82766cb9dcb = external global i8*
17 @fp_dh_9d93c897906e39883c58b034c8e786b2 = external global [5419648 x i8], align 16
18
19 ; Function Attrs: nounwind ssp
20 ; CHECK-NOT: ran out of registers during register allocation
21 ; CHECK-INTERF: error: register allocation failed: maximum interference for recoloring reached
22 ; CHECK-DEPTH: error: register allocation failed: maximum depth for recoloring reached
23 define void @fp_dh_f870bf31fd8ffe068450366e3f05389a(i8* %arg) #0 {
24 bb:
25   indirectbr i8* undef, [label %bb85, label %bb206]
26
27 bb85:                                             ; preds = %bb222, %bb85, %bb
28   store i8* blockaddress(@fp_dh_f870bf31fd8ffe068450366e3f05389a, %bb206), i8** undef, align 4
29   indirectbr i8* undef, [label %bb439, label %bb85]
30
31 bb206:                                            ; preds = %bb
32   %tmp = getelementptr [499 x i32]* @fp_dh_36985b17790d59a27994eaab5dcb00ee, i32 0, i32 undef
33   %tmp207 = load i32* %tmp
34   %tmp208 = add i32 %tmp207, 1
35   %tmp209 = inttoptr i32 %tmp208 to i8*
36   indirectbr i8* %tmp209, [label %bb213]
37
38 bb213:                                            ; preds = %bb206
39   %tmp214 = load i32* @fp_dh_18716afa4a5354de0a302c8edb3b0ee1, align 4
40   %tmp215 = load i8** @fp_dh_20a33cdeefab8f4c8887e82766cb9dcb, align 4
41   %tmp216 = urem i32 -717428541, %tmp214
42   %tmp217 = getelementptr i8* %tmp215, i32 %tmp216
43   %tmp218 = bitcast i8* %tmp217 to i32*
44   %tmp219 = load i32* %tmp218, align 4
45   store i32 %tmp219, i32* undef, align 4
46   %tmp220 = select i1 false, i32 359373646, i32 1677237955
47   %tmp221 = add i32 %tmp220, 0
48   indirectbr i8* undef, [label %bb432, label %bb222]
49
50 bb222:                                            ; preds = %bb213
51   %tmp224 = load i32* undef, align 4
52   %tmp225 = load i32* undef, align 4
53   %tmp226 = xor i32 %tmp225, %tmp224
54   %tmp227 = shl i32 %tmp226, 1
55   %tmp228 = and i32 %tmp227, -2048880334
56   %tmp229 = sub i32 0, %tmp228
57   %tmp230 = add i32 0, %tmp229
58   %tmp231 = xor i32 %tmp230, 1059356227
59   %tmp232 = mul i32 %tmp231, 1603744721
60   %tmp233 = urem i32 %tmp232, 259
61   %tmp234 = getelementptr [259 x i8]* bitcast (i8* getelementptr inbounds ([5419648 x i8]* @fp_dh_9d93c897906e39883c58b034c8e786b2, i32 0, i32 2039075) to [259 x i8]*), i32 0, i32 %tmp233
62   %tmp235 = load i8* %tmp234, align 1
63   %tmp236 = add i32 %tmp233, 2
64   %tmp237 = getelementptr [264 x i8]* bitcast (i8* getelementptr inbounds ([5419648 x i8]* @fp_dh_9d93c897906e39883c58b034c8e786b2, i32 0, i32 3388166) to [264 x i8]*), i32 0, i32 %tmp236
65   %tmp238 = load i8* %tmp237, align 1
66   %tmp239 = getelementptr [265 x i8]* bitcast (i8* getelementptr inbounds ([5419648 x i8]* @fp_dh_9d93c897906e39883c58b034c8e786b2, i32 0, i32 1325165) to [265 x i8]*), i32 0, i32 0
67   %tmp240 = load i8* %tmp239, align 1
68   %tmp241 = add i32 %tmp233, 6
69   %tmp242 = trunc i32 %tmp241 to i8
70   %tmp243 = mul i8 %tmp242, -3
71   %tmp244 = add i8 %tmp243, 3
72   %tmp245 = mul i8 %tmp242, -6
73   %tmp246 = and i8 %tmp245, 6
74   %tmp247 = sub i8 0, %tmp246
75   %tmp248 = add i8 %tmp244, %tmp247
76   %tmp249 = load i8* undef, align 1
77   %tmp250 = xor i8 %tmp235, 17
78   %tmp251 = xor i8 %tmp250, %tmp238
79   %tmp252 = xor i8 %tmp251, %tmp240
80   %tmp253 = xor i8 %tmp252, %tmp249
81   %tmp254 = xor i8 %tmp253, %tmp248
82   %tmp255 = zext i8 %tmp254 to i16
83   %tmp256 = shl nuw i16 %tmp255, 8
84   %tmp257 = load i8* null, align 1
85   %tmp258 = load i32* @fp_dh_18716afa4a5354de0a302c8edb3b0ee1, align 4
86   %tmp259 = load i8** @fp_dh_20a33cdeefab8f4c8887e82766cb9dcb, align 4
87   %tmp260 = urem i32 -717428541, %tmp258
88   %tmp261 = getelementptr i8* %tmp259, i32 %tmp260
89   %tmp262 = bitcast i8* %tmp261 to i32*
90   %tmp263 = load i32* %tmp262, align 4
91   %tmp264 = xor i32 %tmp263, 0
92   %tmp265 = shl i32 %tmp264, 1
93   %tmp266 = and i32 %tmp265, -1312119832
94   %tmp267 = sub i32 0, %tmp266
95   %tmp268 = add i32 0, %tmp267
96   %tmp269 = xor i32 %tmp268, 623994670
97   %tmp270 = mul i32 %tmp269, 1603744721
98   %tmp271 = urem i32 %tmp270, 259
99   %tmp274 = add i32 %tmp271, 3
100   %tmp275 = getelementptr [265 x i8]* bitcast (i8* getelementptr inbounds ([5419648 x i8]* @fp_dh_9d93c897906e39883c58b034c8e786b2, i32 0, i32 1325165) to [265 x i8]*), i32 0, i32 %tmp274
101   %tmp276 = load i8* %tmp275, align 1
102   %tmp277 = add i32 %tmp271, 6
103   %tmp278 = trunc i32 %tmp277 to i8
104   %tmp279 = mul i8 %tmp278, -3
105   %tmp280 = add i8 %tmp279, 31
106   %tmp281 = add i8 %tmp280, 0
107   %tmp282 = xor i8 %tmp257, 13
108   %tmp283 = xor i8 %tmp282, 0
109   %tmp284 = xor i8 %tmp283, 0
110   %tmp285 = xor i8 %tmp284, %tmp276
111   %tmp286 = xor i8 %tmp285, %tmp281
112   %tmp287 = zext i8 %tmp286 to i16
113   %tmp288 = or i16 %tmp287, %tmp256
114   %tmp289 = xor i16 %tmp288, 14330
115   %tmp290 = add i16 0, %tmp289
116   %tmp291 = add i16 %tmp290, -14330
117   %tmp292 = zext i16 %tmp291 to i32
118   %tmp293 = add i16 %tmp290, -14330
119   %tmp294 = lshr i16 %tmp293, 12
120   %tmp295 = zext i16 %tmp294 to i32
121   %tmp296 = sub i32 0, %tmp295
122   %tmp297 = xor i32 %tmp296, 16
123   %tmp298 = add i32 0, %tmp297
124   %tmp299 = and i32 %tmp298, 31
125   %tmp300 = and i32 %tmp292, 30864
126   %tmp301 = shl i32 %tmp300, %tmp299
127   %tmp302 = xor i32 0, %tmp301
128   %tmp303 = add i32 0, %tmp302
129   %tmp304 = and i32 %tmp298, 31
130   %tmp305 = and i32 %tmp303, 25568
131   %tmp306 = lshr i32 %tmp305, %tmp304
132   %tmp307 = xor i32 0, %tmp306
133   %tmp308 = add i32 0, %tmp307
134   %tmp309 = trunc i32 %tmp308 to i16
135   %tmp310 = shl i16 %tmp309, 1
136   %tmp311 = and i16 %tmp310, -4648
137   %tmp312 = shl i16 %tmp309, 1
138   %tmp313 = and i16 %tmp312, 4646
139   %tmp314 = xor i16 %tmp311, 17700
140   %tmp315 = xor i16 %tmp313, 17700
141   %tmp316 = add i16 %tmp314, %tmp315
142   %tmp317 = and i16 %tmp314, %tmp315
143   %tmp318 = shl nuw i16 %tmp317, 1
144   %tmp319 = sub i16 0, %tmp318
145   %tmp320 = add i16 %tmp316, %tmp319
146   %tmp321 = and i16 %tmp320, 29906
147   %tmp322 = xor i16 %tmp309, 14953
148   %tmp323 = add i16 0, %tmp322
149   %tmp324 = sub i16 0, %tmp321
150   %tmp325 = xor i16 %tmp324, %tmp323
151   %tmp326 = add i16 0, %tmp325
152   %tmp327 = add i32 %tmp221, 1161362661
153   %tmp333 = icmp eq i16 %tmp326, 14953
154   %tmp334 = add i32 %tmp327, -1456704142
155   %tmp335 = zext i1 %tmp333 to i32
156   %tmp336 = add i32 %tmp334, %tmp335
157   %tmp337 = getelementptr [499 x i32]* @fp_dh_36985b17790d59a27994eaab5dcb00ee, i32 0, i32 %tmp336
158   %tmp338 = load i32* %tmp337
159   %tmp339 = add i32 %tmp338, 1
160   %tmp340 = inttoptr i32 %tmp339 to i8*
161   indirectbr i8* %tmp340, [label %bb85, label %bb439]
162
163 bb432:                                            ; preds = %bb432, %bb213
164   %tmp433 = phi i32 [ %tmp221, %bb213 ], [ %tmp433, %bb432 ]
165   %tmp434 = add i32 %tmp433, 1022523279
166   %tmp435 = getelementptr [499 x i32]* @fp_dh_36985b17790d59a27994eaab5dcb00ee, i32 0, i32 %tmp434
167   %tmp436 = load i32* %tmp435
168   %tmp437 = add i32 %tmp436, 1
169   %tmp438 = inttoptr i32 %tmp437 to i8*
170   indirectbr i8* %tmp438, [label %bb432]
171
172 bb439:                                            ; preds = %bb222, %bb85
173   ret void
174 }
175
176 attributes #0 = { nounwind ssp "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }