Replace CastInst::createInferredCast calls with more accurate cast
creation calls.

llvm-svn: 32521
diff --git a/llvm/lib/Transforms/Utils/LowerAllocations.cpp b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
index d011d75..30b0ab8 100644
--- a/llvm/lib/Transforms/Utils/LowerAllocations.cpp
+++ b/llvm/lib/Transforms/Utils/LowerAllocations.cpp
@@ -135,7 +135,8 @@
         } else {
           Value *Scale = MI->getOperand(0);
           if (Scale->getType() != IntPtrTy)
-            Scale = CastInst::createInferredCast(Scale, IntPtrTy, "", I);
+            Scale = CastInst::createIntegerCast(Scale, IntPtrTy, false /*ZExt*/,
+                                                "", I);
 
           // Multiply it by the array size if necessary...
           MallocArg = BinaryOperator::create(Instruction::Mul, Scale,
@@ -149,13 +150,12 @@
       if (MallocFTy->getNumParams() > 0 || MallocFTy->isVarArg()) {
         if (MallocFTy->isVarArg()) {
           if (MallocArg->getType() != IntPtrTy)
-            MallocArg = CastInst::createInferredCast(MallocArg, IntPtrTy, "", 
-                                                     I);
+            MallocArg = CastInst::createIntegerCast(MallocArg, IntPtrTy, 
+                                                    false /*ZExt*/, "", I);
         } else if (MallocFTy->getNumParams() > 0 &&
                    MallocFTy->getParamType(0) != Type::UIntTy)
-          MallocArg = 
-            CastInst::createInferredCast(MallocArg, MallocFTy->getParamType(0),
-                                         "",I);
+          MallocArg = CastInst::createIntegerCast(
+              MallocArg, MallocFTy->getParamType(0), false/*ZExt*/, "",I);
         MallocArgs.push_back(MallocArg);
       }
 
@@ -170,7 +170,7 @@
       // Create a cast instruction to convert to the right type...
       Value *MCast;
       if (MCall->getType() != Type::VoidTy)
-        MCast = CastInst::createInferredCast(MCall, MI->getType(), "", I);
+        MCast = new BitCastInst(MCall, MI->getType(), "", I);
       else
         MCast = Constant::getNullValue(MI->getType());
 
@@ -187,8 +187,7 @@
         Value *MCast = FI->getOperand(0);
         if (FreeFTy->getNumParams() > 0 &&
             FreeFTy->getParamType(0) != MCast->getType())
-          MCast = CastInst::createInferredCast(MCast, FreeFTy->getParamType(0), 
-                                               "", I);
+          MCast = new BitCastInst(MCast, FreeFTy->getParamType(0), "", I);
         FreeArgs.push_back(MCast);
       }