From: Simon Pilgrim Date: Wed, 29 Mar 2017 12:09:25 +0000 (+0000) Subject: [AMDGPU] Tidy up computeKnownBitsForTargetNode/ComputeNumSignBitsForTargetNode argume... X-Git-Tag: llvmorg-5.0.0-rc1~8967 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b670ba4e870315d3d3c5889ab8dfafe054ab087e;p=platform%2Fupstream%2Fllvm.git [AMDGPU] Tidy up computeKnownBitsForTargetNode/ComputeNumSignBitsForTargetNode arguments. NFCI. Based on comment in D31249. llvm-svn: 298991 --- diff --git a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp index af3c9ff..efb5052 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp @@ -3555,13 +3555,11 @@ SDValue AMDGPUTargetLowering::getRecipEstimate(SDValue Operand, } void AMDGPUTargetLowering::computeKnownBitsForTargetNode( - const SDValue Op, - APInt &KnownZero, - APInt &KnownOne, - const SelectionDAG &DAG, - unsigned Depth) const { + const SDValue Op, APInt &KnownZero, APInt &KnownOne, + const SelectionDAG &DAG, unsigned Depth) const { - KnownZero = KnownOne = APInt(KnownOne.getBitWidth(), 0); // Don't know anything. + unsigned BitWidth = KnownZero.getBitWidth(); + KnownZero = KnownOne = APInt(BitWidth, 0); // Don't know anything. APInt KnownZero2; APInt KnownOne2; @@ -3582,17 +3580,14 @@ void AMDGPUTargetLowering::computeKnownBitsForTargetNode( if (!CWidth) return; - unsigned BitWidth = 32; uint32_t Width = CWidth->getZExtValue() & 0x1f; if (Opc == AMDGPUISD::BFE_U32) - KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - Width); + KnownZero = APInt::getHighBitsSet(32, 32 - Width); break; } case AMDGPUISD::FP_TO_FP16: { - unsigned BitWidth = KnownZero.getBitWidth(); - // High bits are zero. KnownZero = APInt::getHighBitsSet(BitWidth, BitWidth - 16); break; @@ -3601,9 +3596,7 @@ void AMDGPUTargetLowering::computeKnownBitsForTargetNode( } unsigned AMDGPUTargetLowering::ComputeNumSignBitsForTargetNode( - SDValue Op, - const SelectionDAG &DAG, - unsigned Depth) const { + SDValue Op, const SelectionDAG &DAG, unsigned Depth) const { switch (Op.getOpcode()) { case AMDGPUISD::BFE_I32: { ConstantSDNode *Width = dyn_cast(Op.getOperand(2));