Fix roundtripping of Thumb BL/BLX instructions with immediate offsets instead of...
[oota-llvm.git] / lib / VMCore / Constants.cpp
index 8b41ab75e25665d4985062cd6966b7d68e40aae7..ba309d9ca0714a96a6e11a4ad13ec65e152ab0e4 100644 (file)
@@ -65,9 +65,9 @@ bool Constant::isNullValue() const {
 bool Constant::isAllOnesValue() const {
   // Check for -1 integers
   if (const ConstantInt *CI = dyn_cast<ConstantInt>(this))
-    return CI->isAllOnesValue();
+    return CI->isMinusOne();
 
-  // +0.0 is null.
+  // Check for FP which are bitcasted from -1 integers
   if (const ConstantFP *CFP = dyn_cast<ConstantFP>(this))
     return CFP->getValueAPF().bitcastToAPInt().isAllOnesValue();