diff options
author | Chris Lattner <sabre@nondot.org> | 2008-11-21 16:42:48 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-11-21 16:42:48 +0000 |
commit | 824b958e6fb1236e92e4d07f3acf18fca107cdc0 (patch) | |
tree | f91d265e59851bb2409eb6784c8a83b1d18b8267 /lib/Transforms/Scalar/SimplifyLibCalls.cpp | |
parent | dc770929cb2f97397970e2942b746839fc387992 (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/SimplifyLibCalls.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SimplifyLibCalls.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index 2fbc25e0bd..89527477a8 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -130,9 +130,10 @@ Value *LibCallOptimization::EmitStrLen(Value *Ptr, IRBuilder<> &B) { Value *LibCallOptimization::EmitMemCpy(Value *Dst, Value *Src, Value *Len, unsigned Align, IRBuilder<> &B) { Module *M = Caller->getParent(); - Intrinsic::ID IID = Len->getType() == Type::Int32Ty ? - Intrinsic::memcpy_i32 : Intrinsic::memcpy_i64; - Value *MemCpy = Intrinsic::getDeclaration(M, IID); + Intrinsic::ID IID = Intrinsic::memcpy; + const Type *Tys[1]; + Tys[0] = Len->getType(); + Value *MemCpy = Intrinsic::getDeclaration(M, IID, Tys, 1); return B.CreateCall4(MemCpy, CastToCStr(Dst, B), CastToCStr(Src, B), Len, ConstantInt::get(Type::Int32Ty, Align)); } |