aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/opt/opt.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/opt/opt.cpp b/tools/opt/opt.cpp
index a4ad9ab..292a42a 100644
--- a/tools/opt/opt.cpp
+++ b/tools/opt/opt.cpp
@@ -288,7 +288,17 @@ void AddOptimizationPasses(PassManager &MPM, FunctionPassManager &FPM,
unsigned OptLevel) {
createStandardFunctionPasses(&FPM, OptLevel);
- llvm::Pass *InliningPass = OptLevel > 1 ? createFunctionInliningPass() : 0;
+ llvm::Pass *InliningPass = 0;
+ if (DisableInline) {
+ // No inlining pass
+ } else if (OptLevel) {
+ unsigned Threshold = 200;
+ if (OptLevel > 2)
+ Threshold = 250;
+ InliningPass = createFunctionInliningPass(Threshold);
+ } else {
+ InliningPass = createAlwaysInlinerPass();
+ }
createStandardModulePasses(&MPM, OptLevel,
/*OptimizeSize=*/ false,
UnitAtATime,