[llvm-commits] [llvm] r55708 - in /llvm/trunk/lib/Transforms/IPO: InlineSimple.cpp Inliner.cpp
Devang Patel
dpatel at apple.com
Wed Sep 3 11:10:22 PDT 2008
Author: dpatel
Date: Wed Sep 3 13:10:21 2008
New Revision: 55708
URL: http://llvm.org/viewvc/llvm-project?rev=55708&view=rev
Log:
Handle "noinline" note inside the simple inliner.
Modified:
llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
llvm/trunk/lib/Transforms/IPO/Inliner.cpp
Modified: llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp?rev=55708&r1=55707&r2=55708&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/InlineSimple.cpp Wed Sep 3 13:10:21 2008
@@ -63,6 +63,11 @@
Module &M = CG.getModule();
+ for (Module::iterator I = M.begin(), E = M.end();
+ I != E; ++I)
+ if (!I->isDeclaration() && I->getNotes() == FN_NOTE_NoInline)
+ NeverInline.insert(I);
+
// Get llvm.noinline
GlobalVariable *GV = M.getNamedGlobal("llvm.noinline");
Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=55708&r1=55707&r2=55708&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Wed Sep 3 13:10:21 2008
@@ -144,10 +144,8 @@
bool AlwaysInline = false;
if (Fn && (Fn->getNotes() & FN_NOTE_AlwaysInline))
AlwaysInline = true;
- if (Fn && (Fn->getNotes() & FN_NOTE_NoInline))
- DOUT << "NOT Inlining: inline=never is set" << *CS.getInstruction();
- else if (!AlwaysInline
- && InlineCost >= (int)(InlineThreshold * FudgeFactor)) {
+ if (!AlwaysInline
+ && InlineCost >= (int)(InlineThreshold * FudgeFactor)) {
DOUT << " NOT Inlining: cost=" << InlineCost
<< ", Call: " << *CS.getInstruction();
} else {
More information about the llvm-commits
mailing list