From 882c083889e6d56231e0efc59080376b2c96698a Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 31 Dec 2021 23:15:53 +0000 Subject: [DAG] TargetLowering::SimplifySetCC - use APInt::getMinSignedBits() helper. NFC. --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 2781c760d297..9cca6c895196 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -3678,9 +3678,7 @@ SDValue TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, } // Figure out how many bits we need to preserve this constant. - unsigned ReqdBits = Signed ? - C1.getBitWidth() - C1.getNumSignBits() + 1 : - C1.getActiveBits(); + unsigned ReqdBits = Signed ? C1.getMinSignedBits() : C1.getActiveBits(); // Make sure we're not losing bits from the constant. if (MinBits > 0 && -- cgit v1.2.1