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 /include/llvm | |
parent | dc770929cb2f97397970e2942b746839fc387992 (diff) | |
download | external_llvm-824b958e6fb1236e92e4d07f3acf18fca107cdc0.zip external_llvm-824b958e6fb1236e92e4d07f3acf18fca107cdc0.tar.gz external_llvm-824b958e6fb1236e92e4d07f3acf18fca107cdc0.tar.bz2 |
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 'include/llvm')
-rw-r--r-- | include/llvm/IntrinsicInst.h | 18 | ||||
-rw-r--r-- | include/llvm/Intrinsics.td | 34 |
2 files changed, 14 insertions, 38 deletions
diff --git a/include/llvm/IntrinsicInst.h b/include/llvm/IntrinsicInst.h index 2ef07af..1877eec 100644 --- a/include/llvm/IntrinsicInst.h +++ b/include/llvm/IntrinsicInst.h @@ -208,12 +208,9 @@ namespace llvm { static inline bool classof(const MemIntrinsic *) { return true; } static inline bool classof(const IntrinsicInst *I) { switch (I->getIntrinsicID()) { - case Intrinsic::memcpy_i32: - case Intrinsic::memcpy_i64: - case Intrinsic::memmove_i32: - case Intrinsic::memmove_i64: - case Intrinsic::memset_i32: - case Intrinsic::memset_i64: + case Intrinsic::memcpy: + case Intrinsic::memmove: + case Intrinsic::memset: return true; default: return false; } @@ -246,8 +243,7 @@ namespace llvm { // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const MemCpyInst *) { return true; } static inline bool classof(const IntrinsicInst *I) { - return I->getIntrinsicID() == Intrinsic::memcpy_i32 || - I->getIntrinsicID() == Intrinsic::memcpy_i64; + return I->getIntrinsicID() == Intrinsic::memcpy; } static inline bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); @@ -275,8 +271,7 @@ namespace llvm { // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const MemMoveInst *) { return true; } static inline bool classof(const IntrinsicInst *I) { - return I->getIntrinsicID() == Intrinsic::memmove_i32 || - I->getIntrinsicID() == Intrinsic::memmove_i64; + return I->getIntrinsicID() == Intrinsic::memmove; } static inline bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); @@ -299,8 +294,7 @@ namespace llvm { // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const MemSetInst *) { return true; } static inline bool classof(const IntrinsicInst *I) { - return I->getIntrinsicID() == Intrinsic::memset_i32 || - I->getIntrinsicID() == Intrinsic::memset_i64; + return I->getIntrinsicID() == Intrinsic::memset; } static inline bool classof(const Value *V) { return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); diff --git a/include/llvm/Intrinsics.td b/include/llvm/Intrinsics.td index 194ab5b..3037fbc 100644 --- a/include/llvm/Intrinsics.td +++ b/include/llvm/Intrinsics.td @@ -193,33 +193,15 @@ def int_stackprotector : Intrinsic<[llvm_void_ty], // let Properties = [IntrWriteArgMem] in { - def int_memcpy_i16 : Intrinsic<[llvm_void_ty], + def int_memcpy : Intrinsic<[llvm_void_ty], + [llvm_ptr_ty, llvm_ptr_ty, + llvm_anyint_ty, llvm_i32_ty]>; + def int_memmove : Intrinsic<[llvm_void_ty], [llvm_ptr_ty, llvm_ptr_ty, - llvm_i16_ty, llvm_i16_ty]>; - def int_memcpy_i32 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_ptr_ty, - llvm_i32_ty, llvm_i32_ty]>; - def int_memcpy_i64 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_ptr_ty, - llvm_i64_ty, llvm_i32_ty]>; - def int_memmove_i16 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_ptr_ty, - llvm_i16_ty, llvm_i16_ty]>; - def int_memmove_i32 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_ptr_ty, - llvm_i32_ty, llvm_i32_ty]>; - def int_memmove_i64 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_ptr_ty, - llvm_i64_ty, llvm_i32_ty]>; - def int_memset_i16 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_i8_ty, - llvm_i16_ty, llvm_i16_ty]>; - def int_memset_i32 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_i8_ty, - llvm_i32_ty, llvm_i32_ty]>; - def int_memset_i64 : Intrinsic<[llvm_void_ty], - [llvm_ptr_ty, llvm_i8_ty, - llvm_i64_ty, llvm_i32_ty]>; + llvm_anyint_ty, llvm_i32_ty]>; + def int_memset : Intrinsic<[llvm_void_ty], + [llvm_ptr_ty, llvm_i8_ty, + llvm_anyint_ty, llvm_i32_ty]>; } // These functions do not actually read memory, but they are sensitive to the |