This is an archive of the discontinued LLVM Phabricator instance.

[mlir][vector] set alignment when lowering transfer_read and transfer_write.
ClosedPublic

Authored by whchung on May 1 2020, 9:52 AM.

Details

Summary

When emitting masked load / store, set alignment from data layout.

Diff Detail

Event Timeline

whchung created this revision.May 1 2020, 9:52 AM
whchung added a comment.EditedMay 1 2020, 9:58 AM

@ftynse This patch is somewhat related to our discussion in D79019. It now becomes evident it's better to specify target triple and data layout in llvm dialect.

ftynse added a comment.May 4 2020, 1:41 AM

It now becomes evident it's better to specify target triple and data layout in llvm dialect.

It should be in the *->llvm conversion. However, the conversion is not very well structured for extension atm, and we would have to patch all *->llvm to take the data layout and forward it to the relevant palce.

mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
755

We tend to use arguments passed by-reference to return extra results, or named structs.

757

Type converter mail fail and return nullptr, what's the contract with this function on it?

ftynse accepted this revision.May 4 2020, 1:41 AM
This revision is now accepted and ready to land.May 4 2020, 1:41 AM
whchung updated this revision to Diff 262229.May 5 2020, 2:37 PM

Address code review comments adding more checks.

whchung marked 2 inline comments as done.May 5 2020, 2:38 PM

@ftynse Revised the patch addressing your comments. Could you help review it again, and help get it landed should the patch is okay with you? Thanks.

This revision was automatically updated to reflect the committed changes.

This breaks transfer read/write operations when using the mlir cpu runner in JIT mode, probably due to inconsistencies between the data layouts.

rriddle added inline comments.May 27 2020, 12:18 PM
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
755

nit: Static functions should be marked static and in the top-level namespace, i.e., not within an anonymous namespace.