aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/InlineCost.cpp
diff options
context:
space:
mode:
authorVictor Hernandez <vhernandez@apple.com>2009-09-18 22:35:49 +0000
committerVictor Hernandez <vhernandez@apple.com>2009-09-18 22:35:49 +0000
commit83d63919bd990ce00f62e18114504b9e4a5cb35e (patch)
treeec65b941c26a912ddafb03e9d31922bd73a366b7 /lib/Transforms/Utils/InlineCost.cpp
parent4a86348bfb1dd06ac3ec204a8b295576873701e1 (diff)
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
Reviewed by Dan Gohman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/InlineCost.cpp')
-rw-r--r--lib/Transforms/Utils/InlineCost.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp
index fe4d060e9a..7bf2366158 100644
--- a/lib/Transforms/Utils/InlineCost.cpp
+++ b/lib/Transforms/Utils/InlineCost.cpp
@@ -13,6 +13,7 @@
#include "llvm/Transforms/Utils/InlineCost.h"
+#include "llvm/Analysis/MallocHelper.h"
#include "llvm/Support/CallSite.h"
#include "llvm/CallingConv.h"
#include "llvm/IntrinsicInst.h"
@@ -51,7 +52,7 @@ unsigned InlineCostAnalyzer::FunctionInfo::
// Unfortunately, we don't know the pointer that may get propagated here,
// so we can't make this decision.
if (Inst.mayReadFromMemory() || Inst.mayHaveSideEffects() ||
- isa<AllocationInst>(Inst))
+ isa<AllocationInst>(Inst) || isMalloc(&Inst))
continue;
bool AllOperandsConstant = true;