diff options
-rw-r--r-- | include/llvm/CodeGen/SelectionDAGNodes.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index 6d5d26223f..adb85f0e96 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -605,7 +605,9 @@ public: bool isNullValue() const { return Value == 0; } bool isAllOnesValue() const { - return Value == (1ULL << MVT::getSizeInBits(getValueType(0)))-1; + int NumBits = MVT::getSizeInBits(getValueType(0)); + if (NumBits == 64) return Value+1 == 0; + return Value == (1ULL << NumBits)-1; } static bool classof(const ConstantSDNode *) { return true; } |