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 | bfa535af9fe3208bf64c9acdf4cbb17be6f54d43 (patch) | |
tree | 862e9e345521c3c7da7e1afd09fc705859174822 /llvm/lib | |
parent | 09ff2e7372497312019323ea378784d1a3935e39 (diff) | |
download | bcm5719-llvm-bfa535af9fe3208bf64c9acdf4cbb17be6f54d43.tar.gz bcm5719-llvm-bfa535af9fe3208bf64c9acdf4cbb17be6f54d43.zip |
respect inline=never and inline=always notes.
llvm-svn: 55673
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/IPO/Inliner.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/Inliner.cpp b/llvm/lib/Transforms/IPO/Inliner.cpp index 1c3d5a81f36..e9ae21f7951 100644 --- a/llvm/lib/Transforms/IPO/Inliner.cpp +++ b/llvm/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 { |