Try again
authorEvan Cheng <evan.cheng@apple.com>
Mon, 27 Mar 2006 08:10:26 +0000 (08:10 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 27 Mar 2006 08:10:26 +0000 (08:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27171 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp

index 8fec8a268be8cbd3a1988bc21e5a36785530f2b5..43679c7daad7b18e4dd4cda35807a0436bd9b551 100644 (file)
@@ -91,9 +91,16 @@ bool ISD::isBuildVectorAllOnes(const SDNode *N) {
     if (!cast<ConstantSDNode>(NotZero)->isAllOnesValue())
       return false;
   } else if (isa<ConstantFPSDNode>(NotZero)) {
-    if (DoubleToBits(cast<ConstantFPSDNode>(NotZero)->getValue()) ==
-        (0ULL - 1))
-      return false;
+    MVT::ValueType VT = NotZero.getValueType();
+    if (VT== MVT::f64) {
+      if (DoubleToBits(cast<ConstantFPSDNode>(NotZero)->getValue()) !=
+          (uint64_t)-1)
+        return false;
+    } else {
+      if (FloatToBits(cast<ConstantFPSDNode>(NotZero)->getValue()) !=
+          (uint32_t)-1)
+        return false;
+    }
   } else
     return false;