Skip to content

Commit 152f3f4

Browse files
kazutakahiratagithub-actions[bot]
authored andcommitted
Automerge: [mlir] Use llvm::bit_width (NFC) (#138648)
Note that bit_width is implemented as: std::numeric_limits<T>::digits - llvm::countl_zero(Value);
2 parents efdc65a + 7313c3b commit 152f3f4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class I64BitSet {
122122
unsigned m = llvm::countr_zero(storage);
123123
return m == 64 ? -1 : m;
124124
}
125-
unsigned max() const { return 64 - llvm::countl_zero(storage); }
125+
unsigned max() const { return llvm::bit_width(storage); }
126126
unsigned count() const { return llvm::popcount(storage); }
127127
bool empty() const { return storage == 0; }
128128
};

0 commit comments

Comments
 (0)