From f8631cd1deed13d45bf36b796dd4f27cf1439776 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 14 Apr 2017 06:43:29 +0000 Subject: [PATCH] [ValueTracking] Use APInt::sext instead of zext and setBitsFrom. NFC llvm-svn: 300307 --- llvm/lib/Analysis/ValueTracking.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index 3f8f645..721c01b 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1078,15 +1078,10 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero, KnownZero = KnownZero.trunc(SrcBitWidth); KnownOne = KnownOne.trunc(SrcBitWidth); computeKnownBits(I->getOperand(0), KnownZero, KnownOne, Depth + 1, Q); - KnownZero = KnownZero.zext(BitWidth); - KnownOne = KnownOne.zext(BitWidth); - // If the sign bit of the input is known set or clear, then we know the // top bits of the result. - if (KnownZero[SrcBitWidth-1]) // Input sign bit known zero - KnownZero.setBitsFrom(SrcBitWidth); - else if (KnownOne[SrcBitWidth-1]) // Input sign bit known set - KnownOne.setBitsFrom(SrcBitWidth); + KnownZero = KnownZero.sext(BitWidth); + KnownOne = KnownOne.sext(BitWidth); break; } case Instruction::Shl: { -- 2.7.4