From 23a37099b2f4f36a0c560046dba6c47020308798 Mon Sep 17 00:00:00 2001 From: Dale Johannesen Date: Fri, 5 Sep 2008 21:49:30 +0000 Subject: Mark math lib intrinsics readonly, on the grounds that they read the rounding mode. This is conservatively correct, which they weren't before. We can do more optimization on these if we actually model the rounding mode. llvm-svn: 55860 --- llvm/include/llvm/Intrinsics.td | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'llvm') diff --git a/llvm/include/llvm/Intrinsics.td b/llvm/include/llvm/Intrinsics.td index dc428460ffd..5dd1d6116df 100644 --- a/llvm/include/llvm/Intrinsics.td +++ b/llvm/include/llvm/Intrinsics.td @@ -193,7 +193,10 @@ let Properties = [IntrWriteArgMem] in { llvm_i64_ty, llvm_i32_ty]>; } -let Properties = [IntrNoMem] in { +// These functions do not actually read memory, but they are sensitive to the +// rounding mode. This needs to be modelled separately; in the meantime +// declaring them as reading memory is conservatively correct. +let Properties = [IntrReadMem] in { def int_sqrt : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>; def int_powi : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>, llvm_i32_ty]>; def int_sin : Intrinsic<[llvm_anyfloat_ty, LLVMMatchType<0>]>; -- cgit v1.2.3