diff options
| author | Devang Patel <dpatel@apple.com> | 2008-09-02 22:16:13 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2008-09-02 22:16:13 +0000 |
| commit | a697ae934e6cea0e472b324d6ca7328763992d8a (patch) | |
| tree | 237618f2ff48d969a6b1c7a13a8f7f01cfc5dd3d /lib/Transforms/IPO | |
| parent | d00ed04e9c5e13055f4375af165af2ee4e58735e (diff) | |
| download | external_llvm-a697ae934e6cea0e472b324d6ca7328763992d8a.zip external_llvm-a697ae934e6cea0e472b324d6ca7328763992d8a.tar.gz external_llvm-a697ae934e6cea0e472b324d6ca7328763992d8a.tar.bz2 | |
respect inline=never and inline=always notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55673 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO')
| -rw-r--r-- | lib/Transforms/IPO/Inliner.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp index 1c3d5a8..e9ae21f 100644 --- a/lib/Transforms/IPO/Inliner.cpp +++ b/lib/Transforms/IPO/Inliner.cpp @@ -140,7 +140,14 @@ bool Inliner::runOnSCC(const std::vector<CallGraphNode*> &SCC) { int InlineCost = getInlineCost(CS); float FudgeFactor = getInlineFudgeFactor(CS); - if (InlineCost >= (int)(InlineThreshold * FudgeFactor)) { + Function *Fn = CS.getCalledFunction(); + bool AlwaysInline = false; + if (Fn && (Fn->getNotes() & FP_AlwaysInline)) + AlwaysInline = true; + if (Fn && (Fn->getNotes() & FP_NoInline)) + DOUT << "NOT Inlining: inline=never is set" << *CS.getInstruction(); + else if (!AlwaysInline + && InlineCost >= (int)(InlineThreshold * FudgeFactor)) { DOUT << " NOT Inlining: cost=" << InlineCost << ", Call: " << *CS.getInstruction(); } else { |
