Skip to content

Commit 77523f9

Browse files
committed
[LoongArch] Remove unnecessary increment operations
`HighMask` is the value that sets bits from `Msb+1` to 63 to 1, while the other bits are set to 0.
1 parent 837ee5b commit 77523f9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMatInt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LoongArchMatInt::InstSeq LoongArchMatInt::generateInstSeq(int64_t Val) {
9494

9595
uint64_t Msb = 32;
9696
uint64_t HighMask = ~((1ULL << (Msb + 1)) - 1);
97-
for (; Msb < 64; ++Msb, HighMask = (HighMask << 1) + 1) {
97+
for (; Msb < 64; ++Msb, HighMask = HighMask << 1) {
9898
for (uint64_t Lsb = Msb; Lsb > 0; --Lsb) {
9999
uint64_t LowMask = (1ULL << Lsb) - 1;
100100
uint64_t Mask = HighMask | LowMask;

0 commit comments

Comments
 (0)