summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-01-18 22:38:31 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-01-18 22:38:31 +0000
commit74733a7e46553e37295de9014c5d8a4bd59a0355 (patch)
tree91f5951453d338bc2142f716ccc56569cba9922f /tools
parent9cfb3adf44e14cca2b32c447b36574ef82a7aa6b (diff)
downloadllvm-74733a7e46553e37295de9014c5d8a4bd59a0355.tar.gz
llvm-74733a7e46553e37295de9014c5d8a4bd59a0355.tar.bz2
llvm-74733a7e46553e37295de9014c5d8a4bd59a0355.tar.xz
Make opt -O3 act more like clang -O3 etc., by making the inlining thresholds
match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93798 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-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 a4ad9ab571..292a42aab4 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,