Skip to content

Commit 7313c3b

Browse files
[mlir] Use llvm::bit_width (NFC) (#138648)
Note that bit_width is implemented as: std::numeric_limits<T>::digits - llvm::countl_zero(Value);
1 parent 6a28d8c commit 7313c3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
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)