Skip to content

Commit 8c4e039

Browse files
committed
[LegalizeTypes] Use APInt::getLowBitsSet instead of getAllOnes+zext. NFC
1 parent b728f37 commit 8c4e039

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1066,7 +1066,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_ADDSUBSHLSAT(SDNode *N) {
10661066
unsigned NewBits = PromotedType.getScalarSizeInBits();
10671067

10681068
if (Opcode == ISD::UADDSAT) {
1069-
APInt MaxVal = APInt::getAllOnes(OldBits).zext(NewBits);
1069+
APInt MaxVal = APInt::getLowBitsSet(NewBits, OldBits);
10701070
SDValue SatMax = DAG.getConstant(MaxVal, dl, PromotedType);
10711071
SDValue Add =
10721072
matcher.getNode(ISD::ADD, dl, PromotedType, Op1Promoted, Op2Promoted);

0 commit comments

Comments
 (0)