diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-03 00:00:25 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-03 00:00:25 +0000 |
commit | 03dd4652158f8a4c1db65f066195342d4a3695a7 (patch) | |
tree | df746a0a2881f754162e04bbf46f89477d6c732f /lib/CodeGen/IntrinsicLowering.cpp | |
parent | bad08000f11f9aed65e0e18b8ccf827d16401a42 (diff) |
Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26476 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index c47a107cc3..a02d464981 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -99,15 +99,18 @@ void DefaultIntrinsicLowering::AddPrototypes(Module &M) { EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(), Type::VoidTy); break; - case Intrinsic::memcpy: + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: EnsureFunctionExists(M, "memcpy", I->arg_begin(), --I->arg_end(), I->arg_begin()->getType()); break; - case Intrinsic::memmove: + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: EnsureFunctionExists(M, "memmove", I->arg_begin(), --I->arg_end(), I->arg_begin()->getType()); break; - case Intrinsic::memset: + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: M.getOrInsertFunction("memset", PointerType::get(Type::SByteTy), PointerType::get(Type::SByteTy), Type::IntTy, (--(--I->arg_end()))->getType(), @@ -405,7 +408,8 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { CI->replaceAllUsesWith(Constant::getNullValue(CI->getType())); break; // Simply strip out debugging intrinsics - case Intrinsic::memcpy: { + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: { // The memcpy intrinsic take an extra alignment argument that the memcpy // libc function does not. static Function *MemcpyFCache = 0; @@ -413,7 +417,8 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { (*(CI->op_begin()+1))->getType(), MemcpyFCache); break; } - case Intrinsic::memmove: { + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: { // The memmove intrinsic take an extra alignment argument that the memmove // libc function does not. static Function *MemmoveFCache = 0; @@ -421,7 +426,8 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { (*(CI->op_begin()+1))->getType(), MemmoveFCache); break; } - case Intrinsic::memset: { + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: { // The memset intrinsic take an extra alignment argument that the memset // libc function does not. static Function *MemsetFCache = 0; |