Skip to content

Commit 0ee0e03

Browse files
committed
removed wrong const and exceeding bit
1 parent 23cea68 commit 0ee0e03

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Analysis/DemandedBits.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ void DemandedBits::determineLiveOperandBits(
7676
computeKnownBits(V2, Known2, DL, &AC, UserI, &DT);
7777
}
7878
};
79-
auto GetShiftedRange = [&](unsigned const Min, unsigned const Max,
80-
bool ShiftLeft) {
79+
auto GetShiftedRange = [&](unsigned Min, unsigned Max, bool ShiftLeft) {
8180
using ShiftFn = APInt (APInt::*)(unsigned) const;
8281
auto Shift = ShiftLeft ? static_cast<ShiftFn>(&APInt::shl)
8382
: static_cast<ShiftFn>(&APInt::lshr);
@@ -224,7 +223,7 @@ void DemandedBits::determineLiveOperandBits(
224223
unsigned Max = Known.getMaxValue().getLimitedValue(BitWidth - 1);
225224
// Suppose AOut == 0b0000 1001
226225
// [min, max] = [1, 3]
227-
// shift by 1 we get 0b0001 00100
226+
// shift by 1 we get 0b0001 0010
228227
// shift by 2 we get 0b0010 0100
229228
// shift by 3 we get 0b0100 1000
230229
// we take the or for every shift to cover all the positions.

0 commit comments

Comments
 (0)