summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitdd7083452fd0b9f69ed71e00dca3dbf41831586d (patch)
tree5bfc47f2a29ed613c058dee3535d5175b53b717b /llvm/lib/Transforms/Scalar/InstructionCombining.cpp
parent5d58c3a568b64df97ec16b992c7be07adfdf69e6 (diff)
downloadbcm5719-llvm-dd7083452fd0b9f69ed71e00dca3dbf41831586d.tar.gz
bcm5719-llvm-dd7083452fd0b9f69ed71e00dca3dbf41831586d.zip
reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count. llvm-svn: 59823
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index ee6b51cf296..717a46eb82c 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/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;
}
OpenPOWER on IntegriCloud