diff options
author | Eric Christopher <echristo@apple.com> | 2009-10-07 00:02:18 +0000 |
---|---|---|
committer | Eric Christopher <echristo@apple.com> | 2009-10-07 00:02:18 +0000 |
commit | 6ba26317ce74754cd979fd2cb1e0ad907ae86c8a (patch) | |
tree | 01612a82ac3c7528b223c50fae7322f858a6db86 /llvm/lib/Transforms/Utils/InlineCost.cpp | |
parent | 512c5b770f766f5d0dfe4b5d5a3bd15cb934e0fa (diff) | |
download | bcm5719-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.cpp | 4 |
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; |