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 | ee364ee729b66ab7fffa7bea5ac2e8335e611aa0 (patch) | |
tree | 7387c428d622a69a3aa256df753f357638f0594f /llvm/lib | |
parent | f33d8b979b52eb4f1ee00557b112c648cf422d42 (diff) | |
download | bcm5719-llvm-ee364ee729b66ab7fffa7bea5ac2e8335e611aa0.tar.gz bcm5719-llvm-ee364ee729b66ab7fffa7bea5ac2e8335e611aa0.zip |
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.
llvm-svn: 200501
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 1e423c45126..5ebb6130fbb 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/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? |