DebugLoc propagation; adjustment to things omitted
[oota-llvm.git] / include / llvm / Intrinsics.td
index 9a713ceddeb3670a747fa40d1bce5e9dbb389e0d..8145700f3997c6c28d12eb9c21d011b43a434e42 100644 (file)
@@ -51,6 +51,11 @@ def IntrWriteMem : IntrinsicProperty;
 // Commutative - This intrinsic is commutative: X op Y == Y op X.
 def Commutative : IntrinsicProperty;
 
+// NoCapture - The specified argument pointer is not captured by the intrinsic.
+class NoCapture<int argNo> : IntrinsicProperty {
+  int ArgNo = argNo;
+}
+
 //===----------------------------------------------------------------------===//
 // Types used by intrinsics.
 //===----------------------------------------------------------------------===//
@@ -74,6 +79,13 @@ class LLVMMatchType<int num>
   int Number = num;
 }
 
+// Match the type of another intrinsic parameter that is expected to be 
+// an integral vector type, but change the element size to be twice as wide
+// or half as wide as the other type.  This is only useful when the intrinsic
+// is overloaded, so the matched type should be declared as iAny.
+class LLVMExtendedElementVectorType<int num> : LLVMMatchType<num>;
+class LLVMTruncatedElementVectorType<int num> : LLVMMatchType<num>;
+
 def llvm_void_ty       : LLVMType<isVoid>;
 def llvm_anyint_ty     : LLVMType<iAny>;
 def llvm_anyfloat_ty   : LLVMType<fAny>;
@@ -192,35 +204,18 @@ def int_stackprotector : Intrinsic<[llvm_void_ty],
 //===------------------- Standard C Library Intrinsics --------------------===//
 //
 
-let Properties = [IntrWriteArgMem] in {
-  def int_memcpy_i16  : 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]>;
-}
+def int_memcpy  : Intrinsic<[llvm_void_ty],
+                             [llvm_ptr_ty, llvm_ptr_ty, llvm_anyint_ty,
+                              llvm_i32_ty],
+                            [IntrWriteArgMem, NoCapture<0>, NoCapture<1>]>;
+def int_memmove : Intrinsic<[llvm_void_ty],
+                            [llvm_ptr_ty, llvm_ptr_ty, llvm_anyint_ty,
+                             llvm_i32_ty],
+                            [IntrWriteArgMem, NoCapture<0>, NoCapture<1>]>;
+def int_memset  : Intrinsic<[llvm_void_ty],
+                            [llvm_ptr_ty, llvm_i8_ty, llvm_anyint_ty,
+                             llvm_i32_ty],
+                            [IntrWriteArgMem, NoCapture<0>]>;
 
 // These functions do not actually read memory, but they are sensitive to the
 // rounding mode.  This needs to be modelled separately; in the meantime
@@ -314,6 +309,25 @@ def int_init_trampoline : Intrinsic<[llvm_ptr_ty],
                                     []>,
                           GCCBuiltin<"__builtin_init_trampoline">;
 
+//===------------------------ Overflow Intrinsics -------------------------===//
+//
+
+// Expose the carry flag from add operations on two integrals.
+def int_sadd_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
+                                       [LLVMMatchType<0>, LLVMMatchType<0>]>;
+def int_uadd_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
+                                       [LLVMMatchType<0>, LLVMMatchType<0>]>;
+
+def int_ssub_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
+                                       [LLVMMatchType<0>, LLVMMatchType<0>]>;
+def int_usub_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
+                                       [LLVMMatchType<0>, LLVMMatchType<0>]>;
+
+def int_smul_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
+                                       [LLVMMatchType<0>, LLVMMatchType<0>]>;
+def int_umul_with_overflow : Intrinsic<[llvm_anyint_ty, llvm_i1_ty],
+                                       [LLVMMatchType<0>, LLVMMatchType<0>]>;
+
 //===------------------------- Atomic Intrinsics --------------------------===//
 //
 def int_memory_barrier : Intrinsic<[llvm_void_ty],