This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Narrow bitwidth emulation for vector.load
ClosedPublic

Authored by yzhang93 on Jun 29 2023, 8:41 PM.

Details

Summary

This patch is a following for the previous patch https://reviews.llvm.org/D151519.
With this patch, vector.load op with narrow bitwidth (e.g., i4) can be converted to
supported wider bitwidth (e.g., i8).

Diff Detail

Event Timeline

yzhang93 created this revision.Jun 29 2023, 8:41 PM
Herald added a project: Restricted Project. · View Herald Transcript
yzhang93 requested review of this revision.Jun 29 2023, 8:41 PM
yzhang93 edited reviewers, added: hanchung, mravishankar; removed: aartbik, dcaballe.Jun 29 2023, 8:47 PM
hanchung requested changes to this revision.Jun 30 2023, 2:11 PM

overall looks good to me, just few comments

mlir/lib/Dialect/Vector/Transforms/VectorEmulateNarrowType.cpp
52

This should be renamed to *VectorLoad? We have a very similar implementation for memref.load, can we move the static method to mlir/Dialect/MemRef/Utils/MemRefUtils.h, and reuse it here? Maybe can rename it to getLinearizedMemRefAndOffset(...).

164–166

We should just return a failure if this is not implemented yet.

199

add a new line at end of file

This revision now requires changes to proceed.Jun 30 2023, 2:11 PM
yzhang93 requested review of this revision.Jun 30 2023, 10:28 PM
yzhang93 updated this revision to Diff 536513.
yzhang93 marked 2 inline comments as done.
hanchung accepted this revision.Jul 10 2023, 11:14 AM

LGTM except the refactoring part. We can fix it with a follow-up patch.

This revision is now accepted and ready to land.Jul 10 2023, 11:14 AM
This revision was automatically updated to reflect the committed changes.