Revert r199628: "[AArch64 NEON] Fix a bug caused by undef lane when generating VEXT."
[oota-llvm.git] / lib / Support / ConstantRange.cpp
index 1085a45d0a2df9e2b63e52dcb23542a3854c2999..265b6e96a74698486da4881795f8d986bc985faf 100644 (file)
@@ -445,6 +445,11 @@ ConstantRange ConstantRange::signExtend(uint32_t DstTySize) const {
 
   unsigned SrcTySize = getBitWidth();
   assert(SrcTySize < DstTySize && "Not a value extension");
+
+  // special case: [X, INT_MIN) -- not really wrapping around
+  if (Upper.isMinSignedValue())
+    return ConstantRange(Lower.sext(DstTySize), Upper.zext(DstTySize));
+
   if (isFullSet() || isSignWrappedSet()) {
     return ConstantRange(APInt::getHighBitsSet(DstTySize,DstTySize-SrcTySize+1),
                          APInt::getLowBitsSet(DstTySize, SrcTySize-1) + 1);