LoopUnswitch.cpp (198396) | LoopUnswitch.cpp (198892) |
---|---|
1//===-- LoopUnswitch.cpp - Hoist loop-invariant conditionals in loop ------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 416 unchanged lines hidden (view full) --- 425 I != E; ++I) 426 Metrics.analyzeBasicBlock(*I); 427 428 // Limit the number of instructions to avoid causing significant code 429 // expansion, and the number of basic blocks, to avoid loops with 430 // large numbers of branches which cause loop unswitching to go crazy. 431 // This is a very ad-hoc heuristic. 432 if (Metrics.NumInsts > Threshold || | 1//===-- LoopUnswitch.cpp - Hoist loop-invariant conditionals in loop ------===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// --- 416 unchanged lines hidden (view full) --- 425 I != E; ++I) 426 Metrics.analyzeBasicBlock(*I); 427 428 // Limit the number of instructions to avoid causing significant code 429 // expansion, and the number of basic blocks, to avoid loops with 430 // large numbers of branches which cause loop unswitching to go crazy. 431 // This is a very ad-hoc heuristic. 432 if (Metrics.NumInsts > Threshold || |
433 Metrics.NumBlocks * 5 > Threshold) { | 433 Metrics.NumBlocks * 5 > Threshold || 434 Metrics.NeverInline) { |
434 DEBUG(errs() << "NOT unswitching loop %" 435 << currentLoop->getHeader()->getName() << ", cost too high: " 436 << currentLoop->getBlocks().size() << "\n"); 437 return false; 438 } 439 } 440 441 Constant *CondVal; --- 630 unchanged lines hidden --- | 435 DEBUG(errs() << "NOT unswitching loop %" 436 << currentLoop->getHeader()->getName() << ", cost too high: " 437 << currentLoop->getBlocks().size() << "\n"); 438 return false; 439 } 440 } 441 442 Constant *CondVal; --- 630 unchanged lines hidden --- |