diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h index cf5955d6314..0076a637b2a 100644 --- a/include/llvm/CodeGen/SelectionDAGNodes.h +++ b/include/llvm/CodeGen/SelectionDAGNodes.h @@ -1076,9 +1076,7 @@ public: bool isNullValue() const { return Value == 0; } bool isAllOnesValue() const { - int NumBits = MVT::getSizeInBits(getValueType(0)); - if (NumBits == 64) return Value+1 == 0; - return Value == (1ULL << NumBits)-1; + return Value == MVT::getIntVTBitMask(getValueType(0)); } static bool classof(const ConstantSDNode *) { return true; }