From 24e71017aa3a062e6c2b055038ab9ed0ad2d35ae Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 28 Apr 2017 03:36:24 +0000 Subject: [APInt] Use inplace shift methods where possible. NFCI llvm-svn: 301612 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 439f67f1e15..7df762fee30 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2324,8 +2324,8 @@ void SelectionDAG::computeKnownBits(SDValue Op, APInt &KnownZero, if (const APInt *ShAmt = getValidShiftAmountConstant(Op)) { computeKnownBits(Op.getOperand(0), KnownZero, KnownOne, DemandedElts, Depth + 1); - KnownZero = KnownZero << *ShAmt; - KnownOne = KnownOne << *ShAmt; + KnownZero <<= *ShAmt; + KnownOne <<= *ShAmt; // Low bits are known zero. KnownZero.setLowBits(ShAmt->getZExtValue()); } @@ -4161,7 +4161,7 @@ SDValue SelectionDAG::getNode(unsigned Opcode, const SDLoc &DL, EVT VT, auto SignExtendInReg = [&](APInt Val, llvm::EVT ConstantVT) { unsigned FromBits = EVT.getScalarSizeInBits(); Val <<= Val.getBitWidth() - FromBits; - Val = Val.ashr(Val.getBitWidth() - FromBits); + Val.ashrInPlace(Val.getBitWidth() - FromBits); return getConstant(Val, DL, ConstantVT); }; -- cgit v1.2.3