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
diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp
index a61b1a9..b909203 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -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;