Skip to content

Commit 13ed3b4

Browse files
committed
[DivisionByConstantInfo] Use APInt::getLowBitsSet instead of getAllOnes+lshr. NFC
1 parent 2a96071 commit 13ed3b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/Support/DivisionByConstantInfo.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ UnsignedDivisionByConstantInfo::get(const APInt &D, unsigned LeadingZeros,
7979
APInt Delta;
8080
struct UnsignedDivisionByConstantInfo Retval;
8181
Retval.IsAdd = false; // initialize "add" indicator
82-
APInt AllOnes = APInt::getAllOnes(D.getBitWidth()).lshr(LeadingZeros);
82+
APInt AllOnes =
83+
APInt::getLowBitsSet(D.getBitWidth(), D.getBitWidth() - LeadingZeros);
8384
APInt SignedMin = APInt::getSignedMinValue(D.getBitWidth());
8485
APInt SignedMax = APInt::getSignedMaxValue(D.getBitWidth());
8586

0 commit comments

Comments
 (0)