diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-01-31 00:09:00 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-01-31 00:09:00 +0000 |
commit | e932091eb5e17511e0db975811fc5aaf038b7be3 (patch) | |
tree | e48df00a4fb226454a4136aba8109f9cd13b8eef /lib | |
parent | 4b4b8088609c501da779a3de6ab3d98670dc20c4 (diff) | |
download | llvm-e932091eb5e17511e0db975811fc5aaf038b7be3.tar.gz llvm-e932091eb5e17511e0db975811fc5aaf038b7be3.tar.bz2 llvm-e932091eb5e17511e0db975811fc5aaf038b7be3.tar.xz |
Allow speculating llvm.sqrt, fma and fmuladd
This doesn't set errno, so this should be OK.
Also update the documentation to explicitly state
that errno are not set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/ValueTracking.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp index 1e423c4512..5ebb6130fb 100644 --- a/lib/Analysis/ValueTracking.cpp +++ b/lib/Analysis/ValueTracking.cpp @@ -2036,6 +2036,12 @@ bool llvm::isSafeToSpeculativelyExecute(const Value *V, case Intrinsic::umul_with_overflow: case Intrinsic::usub_with_overflow: return true; + // Sqrt should be OK, since the llvm sqrt intrinsic isn't defined to set + // errno like libm sqrt would. + case Intrinsic::sqrt: + case Intrinsic::fma: + case Intrinsic::fmuladd: + return true; // TODO: some fp intrinsics are marked as having the same error handling // as libm. They're safe to speculate when they won't error. // TODO: are convert_{from,to}_fp16 safe? |