aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2009-10-07 00:02:18 +0000
committerEric Christopher <echristo@apple.com>2009-10-07 00:02:18 +0000
commit0704300d88acfd85f64a9243153af2716c2c20a6 (patch)
tree9af10738b5bd3c88b7f55ac5ac579bd777dd7194
parenta7ba3a81c008142a91d799e2ec3152cfd6bbb15f (diff)
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... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83434 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Transforms/Utils/InlineCost.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp
index a61b1a9b0c..b909203f23 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -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;