// 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.
//===----------------------------------------------------------------------===//
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>;
//===------------------- Standard C Library Intrinsics --------------------===//
//
-let Properties = [IntrWriteArgMem] in {
- 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_anyint_ty, llvm_i32_ty]>;
- def int_memset : Intrinsic<[llvm_void_ty],
- [llvm_ptr_ty, llvm_i8_ty,
- llvm_anyint_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
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],