summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/InlineCost.cpp
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
commit6ba26317ce74754cd979fd2cb1e0ad907ae86c8a (patch)
tree01612a82ac3c7528b223c50fae7322f858a6db86 /llvm/lib/Transforms/Utils/InlineCost.cpp
parent512c5b770f766f5d0dfe4b5d5a3bd15cb934e0fa (diff)
downloadbcm5719-llvm-6ba26317ce74754cd979fd2cb1e0ad907ae86c8a.tar.gz
bcm5719-llvm-6ba26317ce74754cd979fd2cb1e0ad907ae86c8a.zip
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... llvm-svn: 83434
Diffstat (limited to 'llvm/lib/Transforms/Utils/InlineCost.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/InlineCost.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineCost.cpp b/llvm/lib/Transforms/Utils/InlineCost.cpp
index a61b1a9b0c2..b909203f234 100644
--- a/llvm/lib/Transforms/Utils/InlineCost.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud