diff options
| author | Dan Gohman <gohman@apple.com> | 2009-09-03 20:34:31 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-09-03 20:34:31 +0000 |
| commit | 41b3f4abc695b3ce178e1db7610b34d3745ed22d (patch) | |
| tree | 4bfaf2eca9b8910a15985d9d8c2ddf10625a5f99 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
| parent | bc3c526a5b0a6c97231ab1af117053fc2c89c491 (diff) | |
| download | external_llvm-41b3f4abc695b3ce178e1db7610b34d3745ed22d.zip external_llvm-41b3f4abc695b3ce178e1db7610b34d3745ed22d.tar.gz external_llvm-41b3f4abc695b3ce178e1db7610b34d3745ed22d.tar.bz2 | |
Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80940 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 11f12c9..0a523fa 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2198,6 +2198,19 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, unsigned Depth) const{ return std::max(FirstAnswer, std::min(VTBits, Mask.countLeadingZeros())); } +bool SelectionDAG::isKnownNeverNaN(SDValue Op) const { + // If we're told that NaNs won't happen, assume they won't. + if (FiniteOnlyFPMath()) + return true; + + // If the value is a constant, we can obviously see if it is a NaN or not. + if (const ConstantFPSDNode *C = dyn_cast<ConstantFPSDNode>(Op)) + return !C->getValueAPF().isNaN(); + + // TODO: Recognize more cases here. + + return false; +} bool SelectionDAG::isVerifiedDebugInfoDesc(SDValue Op) const { GlobalAddressSDNode *GA = dyn_cast<GlobalAddressSDNode>(Op); |
