Skip to content

Commit 341a51a

Browse files
authored
[mlir] Fix shift overflow and warning on LLP64 platforms (Windows) (#74002)
1 parent d0858bf commit 341a51a

File tree

1 file changed

+3
-3
lines changed
  • mlir/include/mlir/Dialect/SparseTensor/IR

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,19 +531,19 @@ static_assert((isUniqueLT(LevelType::Dense) &&
531531
constexpr uint64_t encodeDim(uint64_t i, uint64_t cf, uint64_t cm) {
532532
if (cf != 0) {
533533
assert(cf <= 0xfffff && cm == 0 && i <= 0xfffff);
534-
return (0x01L << 60) | (cf << 20) | i;
534+
return (0x01ULL << 60) | (cf << 20) | i;
535535
}
536536
if (cm != 0) {
537537
assert(cm <= 0xfffff && i <= 0xfffff);
538-
return (0x02L << 60) | (cm << 20) | i;
538+
return (0x02ULL << 60) | (cm << 20) | i;
539539
}
540540
assert(i <= 0x0fffffffffffffffu);
541541
return i;
542542
}
543543
constexpr uint64_t encodeLvl(uint64_t i, uint64_t c, uint64_t ii) {
544544
if (c != 0) {
545545
assert(c <= 0xfffff && ii <= 0xfffff && i <= 0xfffff);
546-
return (0x03L << 60) | (c << 20) | (ii << 40) | i;
546+
return (0x03ULL << 60) | (c << 20) | (ii << 40) | i;
547547
}
548548
assert(i <= 0x0fffffffffffffffu);
549549
return i;

0 commit comments

Comments
 (0)