[llvm] 882c083 - [DAG] TargetLowering::SimplifySetCC - use APInt::getMinSignedBits() helper. NFC.
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 4 05:48:55 PST 2022
Author: Simon Pilgrim
Date: 2022-01-04T13:48:36Z
New Revision: 882c083889e6d56231e0efc59080376b2c96698a
URL: https://github.com/llvm/llvm-project/commit/882c083889e6d56231e0efc59080376b2c96698a
DIFF: https://github.com/llvm/llvm-project/commit/882c083889e6d56231e0efc59080376b2c96698a.diff
LOG: [DAG] TargetLowering::SimplifySetCC - use APInt::getMinSignedBits() helper. NFC.
Added:
Modified:
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
index 2781c760d297c..9cca6c8951968 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 &&
More information about the llvm-commits
mailing list