[llvm-commits] [llvm] r83434 - /llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Eric Christopher echristo at apple.com
Tue Oct 6 17:02:19 PDT 2009


Author: echristo
Date: Tue Oct  6 19:02:18 2009
New Revision: 83434

URL: http://llvm.org/viewvc/llvm-project?rev=83434&view=rev
Log:
While we still have a MallocInst treat it as a call like any other
for inlining.

When MallocInst goes away this code will be subsumed as part of
calls and work just fine...

Modified:
    llvm/trunk/lib/Transforms/Utils/InlineCost.cpp

Modified: llvm/trunk/lib/Transforms/Utils/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineCost.cpp?rev=83434&r1=83433&r2=83434&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineCost.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineCost.cpp Tue Oct  6 19:02:18 2009
@@ -135,6 +135,10 @@
           NumInsts += 5;
       }
       
+      // This, too, is a call.
+      if (isa<MallocInst>(II))
+	NumInsts += 5;
+
       if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) {
         if (!AI->isStaticAlloca())
           this->usesDynamicAlloca = true;





More information about the llvm-commits mailing list