mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
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:
@@ -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));
|
||||
|
Reference in New Issue
Block a user