[ConstantRange] improve my previous patch per Nick suggestion
authorNuno Lopes <nunoplopes@sapo.pt>
Thu, 31 Oct 2013 19:53:53 +0000 (19:53 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Thu, 31 Oct 2013 19:53:53 +0000 (19:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193795 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/ConstantRange.cpp

index e3b43ed6df6178dd614eb921ca715b98a96172ad..265b6e96a74698486da4881795f8d986bc985faf 100644 (file)
@@ -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()) {