Enhance transform passes so that they apply the same tranforms to malloc calls as...
[oota-llvm.git] / lib / Transforms / Utils / InlineCost.cpp
index fe4d060e9ac45723a5079fa18853c6e3565a6f83..7bf2366158763700ed15a8baf4b8125efe952cfb 100644 (file)
@@ -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;