[llvm-commits] CVS: llvm/include/llvm/IntrinsicInst.h Intrinsics.h

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 2 15:57:30 PST 2006



Changes in directory llvm/include/llvm:

IntrinsicInst.h updated: 1.9 -> 1.10
Intrinsics.h updated: 1.36 -> 1.37
---
Log message:

Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709: http://llvm.cs.uiuc.edu/PR709 , and paving the way for future progress.



---
Diffs of the changes:  (+23 -14)

 IntrinsicInst.h |   20 +++++++++++++-------
 Intrinsics.h    |   17 ++++++++++-------
 2 files changed, 23 insertions(+), 14 deletions(-)


Index: llvm/include/llvm/IntrinsicInst.h
diff -u llvm/include/llvm/IntrinsicInst.h:1.9 llvm/include/llvm/IntrinsicInst.h:1.10
--- llvm/include/llvm/IntrinsicInst.h:1.9	Fri Jan 13 14:00:51 2006
+++ llvm/include/llvm/IntrinsicInst.h	Thu Mar  2 17:57:16 2006
@@ -148,9 +148,12 @@
     static inline bool classof(const MemIntrinsic *) { return true; }
     static inline bool classof(const IntrinsicInst *I) {
       switch (I->getIntrinsicID()) {
-      case Intrinsic::memcpy:
-      case Intrinsic::memmove:
-      case Intrinsic::memset:
+      case Intrinsic::memcpy_i32:
+      case Intrinsic::memcpy_i64:
+      case Intrinsic::memmove_i32:
+      case Intrinsic::memmove_i64:
+      case Intrinsic::memset_i32:
+      case Intrinsic::memset_i64:
         return true;
       default: return false;
       }
@@ -183,7 +186,8 @@
     // 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;
+      return I->getIntrinsicID() == Intrinsic::memcpy_i32 ||
+             I->getIntrinsicID() == Intrinsic::memcpy_i64;
     }
     static inline bool classof(const Value *V) {
       return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
@@ -211,14 +215,15 @@
     // 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;
+      return I->getIntrinsicID() == Intrinsic::memmove_i32 ||
+             I->getIntrinsicID() == Intrinsic::memmove_i64;
     }
     static inline bool classof(const Value *V) {
       return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));
     }
   };
 
-  /// MemSetInst - This class wraps the llvm.memcpy intrinsic.
+  /// MemSetInst - This class wraps the llvm.memset intrinsic.
   ///
   struct MemSetInst : public MemIntrinsic {
     /// get* - Return the arguments to the instruction.
@@ -234,7 +239,8 @@
     // 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;
+      return I->getIntrinsicID() == Intrinsic::memset_i32 ||
+             I->getIntrinsicID() == Intrinsic::memset_i64;
     }
     static inline bool classof(const Value *V) {
       return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V));


Index: llvm/include/llvm/Intrinsics.h
diff -u llvm/include/llvm/Intrinsics.h:1.36 llvm/include/llvm/Intrinsics.h:1.37
--- llvm/include/llvm/Intrinsics.h:1.36	Mon Jan 16 15:12:35 2006
+++ llvm/include/llvm/Intrinsics.h	Thu Mar  2 17:57:16 2006
@@ -59,13 +59,16 @@
     dbg_declare,      // Declare a local object
 
     // Standard C library intrinsics.
-    memcpy,         // Copy non-overlapping memory blocks
-    memmove,        // Copy potentially overlapping memory blocks
-    memset,         // Fill memory with a byte value
-    isunordered_f32,// Return true if either float argument is a NaN
-    isunordered_f64,// Return true if either double argument is a NaN
-    sqrt_f32,       // Square root of float
-    sqrt_f64,       // Square root of double
+    memcpy_i32,      // Copy non-overlapping memory blocks.  i32 size.
+    memcpy_i64,      // Copy non-overlapping memory blocks.  i64 size.
+    memmove_i32,     // Copy potentially overlapping memory blocks.  i32 size.
+    memmove_i64,     // Copy potentially overlapping memory blocks.  i64 size.
+    memset_i32,      // Fill memory with a byte value.  i32 size.
+    memset_i64,      // Fill memory with a byte value.  i64 size.
+    isunordered_f32, // Return true if either float argument is a NaN
+    isunordered_f64, // Return true if either double argument is a NaN
+    sqrt_f32,        // Square root of float
+    sqrt_f64,        // Square root of double
 
     // Bit manipulation instrinsics.
     bswap_i16,      // Byteswap 16 bits






More information about the llvm-commits mailing list