Skip to content

[mlir] Fix shift overflow and warning on LLP64 platforms (Windows) #74002

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,19 +531,19 @@ static_assert((isUniqueLT(LevelType::Dense) &&
constexpr uint64_t encodeDim(uint64_t i, uint64_t cf, uint64_t cm) {
if (cf != 0) {
assert(cf <= 0xfffff && cm == 0 && i <= 0xfffff);
return (0x01L << 60) | (cf << 20) | i;
return (0x01ULL << 60) | (cf << 20) | i;
}
if (cm != 0) {
assert(cm <= 0xfffff && i <= 0xfffff);
return (0x02L << 60) | (cm << 20) | i;
return (0x02ULL << 60) | (cm << 20) | i;
}
assert(i <= 0x0fffffffffffffffu);
return i;
}
constexpr uint64_t encodeLvl(uint64_t i, uint64_t c, uint64_t ii) {
if (c != 0) {
assert(c <= 0xfffff && ii <= 0xfffff && i <= 0xfffff);
return (0x03L << 60) | (c << 20) | (ii << 40) | i;
return (0x03ULL << 60) | (c << 20) | (ii << 40) | i;
}
assert(i <= 0x0fffffffffffffffu);
return i;
Expand Down