We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f608ab commit 35ec6eaCopy full SHA for 35ec6ea
mlir/lib/Dialect/MemRef/Transforms/EmulateNarrowType.cpp
@@ -272,6 +272,12 @@ void memref::populateMemRefNarrowTypeEmulationConversions(
272
273
StridedLayoutAttr layoutAttr;
274
if (offset != 0) {
275
+ // Check if the number of bytes are a multiple of the loadStoreWidth
276
+ // and if so, divide it by the loadStoreWidth to get the offset.
277
+ if ((offset * width) % loadStoreWidth != 0)
278
+ return std::nullopt;
279
+ offset = (offset * width) / loadStoreWidth;
280
+
281
layoutAttr = StridedLayoutAttr::get(ty.getContext(), offset,
282
ArrayRef<int64_t>{1});
283
}
0 commit comments