summaryrefslogtreecommitdiff
path: root/lib/Transforms/IPO/Inliner.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-02 23:40:26 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-11-02 23:40:26 +0000
commit930f5efac0f76aa9e3772d9a36757f18b3573112 (patch)
treec161490f3fb62b4823d44bdc2369fbe12eee10a7 /lib/Transforms/IPO/Inliner.cpp
parentac793822cd27554c6409b5c380555f94be48b431 (diff)
downloadllvm-930f5efac0f76aa9e3772d9a36757f18b3573112.tar.gz
llvm-930f5efac0f76aa9e3772d9a36757f18b3573112.tar.bz2
llvm-930f5efac0f76aa9e3772d9a36757f18b3573112.tar.xz
Let the -inline-threshold command line argument take precedence over the
threshold given to createFunctionInliningPass(). Both opt -O3 and clang would silently ignore the -inline-threshold option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/Inliner.cpp')
-rw-r--r--lib/Transforms/IPO/Inliner.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index 4983e8e13a..55f2815461 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -52,7 +52,8 @@ Inliner::Inliner(char &ID)
: CallGraphSCCPass(ID), InlineThreshold(InlineLimit) {}
Inliner::Inliner(char &ID, int Threshold)
- : CallGraphSCCPass(ID), InlineThreshold(Threshold) {}
+ : CallGraphSCCPass(ID), InlineThreshold(InlineLimit.getNumOccurrences() > 0 ?
+ InlineLimit : Threshold) {}
/// getAnalysisUsage - For this class, we declare that we require and preserve
/// the call graph. If the derived class implements this method, it should