While we still have a MallocInst treat it as a call like any other
authorEric Christopher <echristo@apple.com>
Wed, 7 Oct 2009 00:02:18 +0000 (00:02 +0000)
committerEric Christopher <echristo@apple.com>
Wed, 7 Oct 2009 00:02:18 +0000 (00:02 +0000)
for inlining.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83434 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/InlineCost.cpp

index a61b1a9b0c28c202e2c19c98867b4176e1b83c97..b909203f234d3f2ee74e6fc7e451e999738a7f41 100644 (file)
@@ -135,6 +135,10 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
           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;