From: Zhou Sheng Date: Wed, 28 Mar 2007 17:38:21 +0000 (+0000) Subject: Avoid unnecessary APInt construction. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=34a4b38cbd9609b000b3d6e053051789329c488a;p=oota-llvm.git Avoid unnecessary APInt construction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35431 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 907e8dc87ad..d72783a0de6 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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 // top bits of the result. - APInt NewBits(APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth)); 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 - KnownOne |= NewBits; + KnownOne |= APInt::getHighBitsSet(BitWidth, BitWidth - SrcBitWidth); return; } case Instruction::Shl: