diff options
author | Chris Lattner <sabre@nondot.org> | 2006-03-09 18:42:10 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-03-09 18:42:10 +0000 |
commit | a758b8250d43902b32df9b16aa161622a7f1ef23 (patch) | |
tree | ab07a203edf406c5998095cba03165c47a8e9260 /lib/VMCore/AutoUpgrade.cpp | |
parent | ddc877ccaea440447cb32c8faf4c6ac6b6791472 (diff) |
autoupgrade memcpy/memmove/memset with signed counts.
CVS: ----------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/AutoUpgrade.cpp')
-rw-r--r-- | lib/VMCore/AutoUpgrade.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 55cde23993..689a32f958 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -84,10 +84,18 @@ static Function *getUpgradedIntrinsic(Function *F) { case 'm': if (Name == "llvm.memcpy" || Name == "llvm.memset" || Name == "llvm.memmove") { - if (F->getFunctionType()->getParamType(2) == Type::UIntTy) - return M->getOrInsertFunction(Name+".i32", F->getFunctionType()); - if (F->getFunctionType()->getParamType(2) == Type::ULongTy) - return M->getOrInsertFunction(Name+".i64", F->getFunctionType()); + if (F->getFunctionType()->getParamType(2) == Type::UIntTy || + F->getFunctionType()->getParamType(2) == Type::IntTy) + return M->getOrInsertFunction(Name+".i32", Type::VoidTy, + PointerType::get(Type::SByteTy), + F->getFunctionType()->getParamType(1), + Type::UIntTy, Type::UIntTy, NULL); + if (F->getFunctionType()->getParamType(2) == Type::ULongTy || + F->getFunctionType()->getParamType(2) == Type::LongTy) + return M->getOrInsertFunction(Name+".i64", Type::VoidTy, + PointerType::get(Type::SByteTy), + F->getFunctionType()->getParamType(1), + Type::ULongTy, Type::UIntTy, NULL); } break; case 's': |