From 117477e28b8bf3b0f00ff5ce57e65c3162af8862 Mon Sep 17 00:00:00 2001 From: Zhou Sheng Date: Wed, 28 Mar 2007 17:38:21 +0000 Subject: [PATCH] Avoid unnecessary APInt construction. llvm-svn: 35431 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 907e8dc87ad0..d72783a0de69 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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: