Avoid unnecessary APInt construction.

llvm-svn: 35431
This commit is contained in:
Zhou Sheng 2007-03-28 17:38:21 +00:00
parent a6527d6a61
commit 117477e28b
1 changed files with 2 additions and 3 deletions

View File

@ -734,11 +734,10 @@ static void ComputeMaskedBits(Value *V, const APInt &Mask, APInt& KnownZero,
// If the sign bit of the input is known set or clear, then we know the // If the sign bit of the input is known set or clear, then we know the
// top bits of the result. // top bits of the result.
APInt NewBits(APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth));
if (KnownZero[SrcBitWidth-1]) // Input sign bit known zero if (KnownZero[SrcBitWidth-1]) // Input sign bit known zero
KnownZero |= NewBits; KnownZero |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
else if (KnownOne[SrcBitWidth-1]) // Input sign bit known set else if (KnownOne[SrcBitWidth-1]) // Input sign bit known set
KnownOne |= NewBits; KnownOne |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth);
return; return;
} }
case Instruction::Shl: case Instruction::Shl: