summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-09-03 20:34:31 +0000
committerDan Gohman <gohman@apple.com>2009-09-03 20:34:31 +0000
commitd0d5e685daf79262e38a5fe7e782c0372b2cf9f4 (patch)
tree6c12184afb09aa65d1ef0191a1d80e8553615f6b /llvm/lib/CodeGen
parent3c8a7dfada1d39b33a24f58e039d6ba5c6cb3857 (diff)
downloadbcm5719-llvm-d0d5e685daf79262e38a5fe7e782c0372b2cf9f4.tar.gz
bcm5719-llvm-d0d5e685daf79262e38a5fe7e782c0372b2cf9f4.zip
Recognize more opportunities to use SSE min and max instructions,
swapping the operands if necessary. llvm-svn: 80940
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 11f12c9475f..0a523fa8dc2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud