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
This commit is contained in:
Eric Christopher 2009-10-07 00:02:18 +00:00
parent a7ba3a81c0
commit 0704300d88

View 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;