diff options
author | Justin Lebar <jlebar@google.com> | 2016-04-15 01:38:48 +0000 |
---|---|---|
committer | Justin Lebar <jlebar@google.com> | 2016-04-15 01:38:48 +0000 |
commit | 8650a4da93344eb7ed2342a46b2808f44f206507 (patch) | |
tree | d07e0009f3cb7b0f002cc7c803aa88757dcdbeb3 /llvm/lib/Analysis/InlineCost.cpp | |
parent | 7dba2e0d0ca2bb0fec1e8c9a3f718e580a9501cb (diff) | |
download | llvm-8650a4da93344eb7ed2342a46b2808f44f206507.zip llvm-8650a4da93344eb7ed2342a46b2808f44f206507.tar.gz llvm-8650a4da93344eb7ed2342a46b2808f44f206507.tar.bz2 |
[TTI] Add getInliningThresholdMultiplier.
Summary:
InlineCost's threshold is multiplied by this value. This lets us adjust
the inlining threshold up or down on a per-target basis. For example,
we might want to increase the threshold on targets where calls are
unusually expensive.
Reviewers: chandlerc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18560
llvm-svn: 266405
Diffstat (limited to 'llvm/lib/Analysis/InlineCost.cpp')
-rw-r--r-- | llvm/lib/Analysis/InlineCost.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp index c3df122..aa46b68 100644 --- a/llvm/lib/Analysis/InlineCost.cpp +++ b/llvm/lib/Analysis/InlineCost.cpp @@ -655,6 +655,10 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) { ColdThreshold.getNumOccurrences() > 0) && ColdCallee && ColdThreshold < Threshold) Threshold = ColdThreshold; + + // Finally, take the target-specific inlining threshold multiplier into + // account. + Threshold *= TTI.getInliningThresholdMultiplier(); } bool CallAnalyzer::visitCmpInst(CmpInst &I) { |