summaryrefslogtreecommitdiff
path: root/include/llvm/IR
diff options
context:
space:
mode:
authorRaul E. Silvera <rsilvera@google.com>2014-03-06 00:18:15 +0000
committerRaul E. Silvera <rsilvera@google.com>2014-03-06 00:18:15 +0000
commit8b6d60f94b348694cb8aa4c78167bbaad352de31 (patch)
treec07527fc24a2413ac15c0af27db105dec8c36273 /include/llvm/IR
parent001e676e4b919c553ad196510b9c12f93f4913d9 (diff)
downloadllvm-8b6d60f94b348694cb8aa4c78167bbaad352de31.tar.gz
llvm-8b6d60f94b348694cb8aa4c78167bbaad352de31.tar.bz2
llvm-8b6d60f94b348694cb8aa4c78167bbaad352de31.tar.xz
Change math intrinsic attributes from readonly to readnone. These
are operations that do not access memory but may be sensitive to floating-point environment changes. LLVM does not attempt to model FP environment changes, so this was unnecessarily conservative and was getting on the way of some optimizations, in particular SLP vectorization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203037 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/IR')
-rw-r--r--include/llvm/IR/Intrinsics.td25
1 files changed, 11 insertions, 14 deletions
diff --git a/include/llvm/IR/Intrinsics.td b/include/llvm/IR/Intrinsics.td
index f8d8e79c9a..755c9c2b1f 100644
--- a/include/llvm/IR/Intrinsics.td
+++ b/include/llvm/IR/Intrinsics.td
@@ -285,10 +285,17 @@ def int_memset : Intrinsic<[],
llvm_i32_ty, llvm_i1_ty],
[IntrReadWriteArgMem, 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
-// declaring them as reading memory is conservatively correct.
-let Properties = [IntrReadMem] in {
+let Properties = [IntrNoMem] in {
+ def int_fma : Intrinsic<[llvm_anyfloat_ty],
+ [LLVMMatchType<0>, LLVMMatchType<0>,
+ LLVMMatchType<0>]>;
+ def int_fmuladd : Intrinsic<[llvm_anyfloat_ty],
+ [LLVMMatchType<0>, LLVMMatchType<0>,
+ LLVMMatchType<0>]>;
+
+ // These functions do not read memory, but are sensitive to the
+ // rounding mode. LLVM purposely does not model changes to the FP
+ // environment so they can be treated as readnone.
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>]>;
@@ -311,16 +318,6 @@ let Properties = [IntrReadMem] in {
def int_round : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;
}
-let Properties = [IntrNoMem] in {
- def int_fma : Intrinsic<[llvm_anyfloat_ty],
- [LLVMMatchType<0>, LLVMMatchType<0>,
- LLVMMatchType<0>]>;
-
- def int_fmuladd : Intrinsic<[llvm_anyfloat_ty],
- [LLVMMatchType<0>, LLVMMatchType<0>,
- LLVMMatchType<0>]>;
-}
-
// NOTE: these are internal interfaces.
def int_setjmp : Intrinsic<[llvm_i32_ty], [llvm_ptr_ty]>;
def int_longjmp : Intrinsic<[], [llvm_ptr_ty, llvm_i32_ty], [IntrNoReturn]>;