Make mem[cpy,move,set] intrinsics overloaded.
[oota-llvm.git] / lib / Transforms / Scalar / InstructionCombining.cpp
index ee6b51cf2968de012f6cb3bcb77caef8edf08d9d..717a46eb82c28e99d320609001c79e93d69e5723 100644 (file)
@@ -9200,12 +9200,11 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
       if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource()))
         if (GVSrc->isConstant()) {
           Module *M = CI.getParent()->getParent()->getParent();
-          Intrinsic::ID MemCpyID;
-          if (CI.getOperand(3)->getType() == Type::Int32Ty)
-            MemCpyID = Intrinsic::memcpy_i32;
-          else
-            MemCpyID = Intrinsic::memcpy_i64;
-          CI.setOperand(0, Intrinsic::getDeclaration(M, MemCpyID));
+          Intrinsic::ID MemCpyID = Intrinsic::memcpy;
+          const Type *Tys[1];
+          Tys[0] = CI.getOperand(3)->getType();
+          CI.setOperand(0, 
+                        Intrinsic::getDeclaration(M, MemCpyID, Tys, 1));
           Changed = true;
         }