Page MenuHomePhabricator

[mlir][llvm] Pass struct results as parameter in c wrapper.
ClosedPublic

Authored by herhut on Mar 16 2021, 10:44 AM.

Details

Summary

Returning structs directly in LLVM does not necessarily align with the C ABI of the platform. This might happen to work on Linux but for small structs this breaks on Windows. With this change, the wrappers work platform independently.

Diff Detail

Event Timeline

herhut created this revision.Mar 16 2021, 10:44 AM
herhut requested review of this revision.Mar 16 2021, 10:44 AM
ftynse accepted this revision.Mar 17 2021, 3:25 AM
ftynse added inline comments.
mlir/docs/LLVMDialectMemRefConvention.md
235

s/reference/pointer

399–404

It's already defined above

mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
1320

Nit: just cast

This revision is now accepted and ready to land.Mar 17 2021, 3:25 AM
herhut updated this revision to Diff 331213.Mar 17 2021, 4:17 AM
herhut marked 3 inline comments as done.

Review comments...

Thanks!

mlir/docs/LLVMDialectMemRefConvention.md
399–404

Copy/paste mistake. Thanks!

This revision was automatically updated to reflect the committed changes.