-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[NFC][mlir] make the assert consistent with the declared behavior #143874
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
Conversation
@llvm/pr-subscribers-mlir Author: long.chen (lipracer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/143874.diff 1 Files Affected:
diff --git a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
index 918647d9feac3..f355dfb8648ec 100644
--- a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
@@ -48,7 +48,8 @@ inline std::array<int64_t, N> makeStrides(ArrayRef<int64_t> shape) {
std::array<int64_t, N> res;
int64_t running = 1;
for (int64_t idx = N - 1; idx >= 0; --idx) {
- assert(shape[idx] && "size must be non-negative for all shape dimensions");
+ assert(shape[idx] >= 0 &&
+ "size must be non-negative for all shape dimensions");
res[idx] = running;
running *= shape[idx];
}
|
@llvm/pr-subscribers-mlir-execution-engine Author: long.chen (lipracer) ChangesFull diff: https://github.com/llvm/llvm-project/pull/143874.diff 1 Files Affected:
diff --git a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
index 918647d9feac3..f355dfb8648ec 100644
--- a/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
+++ b/mlir/include/mlir/ExecutionEngine/MemRefUtils.h
@@ -48,7 +48,8 @@ inline std::array<int64_t, N> makeStrides(ArrayRef<int64_t> shape) {
std::array<int64_t, N> res;
int64_t running = 1;
for (int64_t idx = N - 1; idx >= 0; --idx) {
- assert(shape[idx] && "size must be non-negative for all shape dimensions");
+ assert(shape[idx] >= 0 &&
+ "size must be non-negative for all shape dimensions");
res[idx] = running;
running *= shape[idx];
}
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/157/builds/30632 Here is the relevant piece of the build log for the reference
|
This error was not introduced from this change. |
No description provided.