@@ -222,14 +222,6 @@ namespace llvm {
222
222
}
223
223
return Total - PHIs;
224
224
};
225
- auto countIntegerOperations = [](BasicBlock* BB) {
226
- unsigned Int_Instructions = 0 ;
227
- for (auto BI = BB->begin (), BE = BB->end (); BI != BE; ++BI) {
228
- if (isa<IntegerType>((&*BI)->getType ()))
229
- ++Int_Instructions;
230
- }
231
- return Int_Instructions;
232
- };
233
225
auto hasLoad = [](BasicBlock* BB) {
234
226
for (auto BI = BB->begin (), BE = BB->end (); BI != BE; ++BI)
235
227
if (isa<LoadInst>(&*BI))
@@ -251,13 +243,11 @@ namespace llvm {
251
243
};
252
244
// For innermost loop, allow certain patterns.
253
245
unsigned Count = 0 ;
254
- unsigned Int_Count = 0 ;
255
246
bool HasCall = false ;
256
247
bool HasStore = false ;
257
248
bool MayHasLoadInHeaderOnly = true ;
258
249
for (auto BI = L->block_begin (), BE = L->block_end (); BI != BE; ++BI) {
259
250
Count += countNonPHI (*BI);
260
- Int_Count += countIntegerOperations (*BI);
261
251
HasCall |= hasCall (*BI);
262
252
HasStore |= hasStore (*BI);
263
253
if (L->getHeader () != *BI)
@@ -273,15 +263,6 @@ namespace llvm {
273
263
// The following is only available and required from LLVM 3.7+.
274
264
UP.AllowExpensiveTripCount = true ;
275
265
}
276
- // Controls stack size growth being too big to compile. When we get into SCEV
277
- // and start processing the i32 instructions we can get too deep in the call stack
278
- // that we cause a stack overflow during compilation.
279
- unsigned Total_Potential_Inst = TripCount * Int_Count;
280
- if (Total_Potential_Inst > 2700 )
281
- {
282
- UP.Threshold = 2000 ;
283
- UP.PartialThreshold = 2000 ;
284
- }
285
266
}
286
267
return ;
287
268
}
0 commit comments