diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index e3b43ed6df6..265b6e96a74 100644 --- a/lib/Support/ConstantRange.cpp +++ b/lib/Support/ConstantRange.cpp @@ -447,7 +447,7 @@ ConstantRange ConstantRange::signExtend(uint32_t DstTySize) const { assert(SrcTySize < DstTySize && "Not a value extension"); // special case: [X, INT_MIN) -- not really wrapping around - if (Upper == APInt::getHighBitsSet(SrcTySize, 1)) + if (Upper.isMinSignedValue()) return ConstantRange(Lower.sext(DstTySize), Upper.zext(DstTySize)); if (isFullSet() || isSignWrappedSet()) {