summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils
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
commit5d034499ad2b0cd99833dd66e9359bf17088fa11 (patch)
treec7c7349c462240747f9fcdd168666acfcc8464c5 /llvm/lib/Transforms/Utils
parent3d8f8625967ac153e80ff100ac88a3393631df24 (diff)
downloadbcm5719-llvm-5d034499ad2b0cd99833dd66e9359bf17088fa11.tar.gz
bcm5719-llvm-5d034499ad2b0cd99833dd66e9359bf17088fa11.zip
Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
Reviewed by Dan Gohman. llvm-svn: 82300
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r--llvm/lib/Transforms/Utils/InlineCost.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/InlineCost.cpp b/llvm/lib/Transforms/Utils/InlineCost.cpp
index fe4d060e9ac..7bf23661587 100644
--- a/llvm/lib/Transforms/Utils/InlineCost.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud