aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/InstructionCombining.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-21 16:42:48 +0000
committerChris Lattner <sabre@nondot.org>2008-11-21 16:42:48 +0000
commit824b958e6fb1236e92e4d07f3acf18fca107cdc0 (patch)
treef91d265e59851bb2409eb6784c8a83b1d18b8267 /lib/Transforms/Scalar/InstructionCombining.cpp
parentdc770929cb2f97397970e2942b746839fc387992 (diff)
reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--lib/Transforms/Scalar/InstructionCombining.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index ee6b51cf29..717a46eb82 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -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;
}