We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c9b55b commit ad5c58dCopy full SHA for ad5c58d
src/jit/mlir.cpp
@@ -266,6 +266,12 @@ ::mlir::Value DepManager::getDependent(::mlir::OpBuilder &builder,
266
static ::mlir::MemRefType getMRType(size_t ndims, intptr_t offset,
267
intptr_t *sizes, intptr_t *strides,
268
::mlir::Type elType) {
269
+ // sanitize strides
270
+ for (size_t i = 0; i < ndims; i++) {
271
+ if (strides[i] == 0) {
272
+ strides[i] = 1;
273
+ }
274
275
auto layout = ::mlir::StridedLayoutAttr::get(elType.getContext(), offset,
276
{strides, ndims});
277
return ::mlir::MemRefType::get({sizes, ndims}, elType, layout);
0 commit comments