Don't use a potentially expensive shift if all we want is one set bit.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186095 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2013-07-11 16:05:50 +00:00
parent 1b3e3eef1f
commit 0a230e0d98
4 changed files with 6 additions and 6 deletions

View File

@@ -433,7 +433,7 @@ ConstantRange ConstantRange::zeroExtend(uint32_t DstTySize) const {
APInt LowerExt(DstTySize, 0);
if (!Upper) // special case: [X, 0) -- not really wrapping around
LowerExt = Lower.zext(DstTySize);
return ConstantRange(LowerExt, APInt(DstTySize, 1).shl(SrcTySize));
return ConstantRange(LowerExt, APInt::getOneBitSet(DstTySize, SrcTySize));
}
return ConstantRange(Lower.zext(DstTySize), Upper.zext(DstTySize));