This is an archive of the discontinued LLVM Phabricator instance.

[mlir][std] allow subview take memrefs from non-zero addrspaces.
ClosedPublic

Authored by whchung on Apr 28 2020, 10:10 AM.

Details

Summary

On certain targets std.subview should be able to take memrefs from non-zero
addrspaces. Improve lowering logic to llvm dialect and amend the tests.

Diff Detail

Event Timeline

whchung created this revision.Apr 28 2020, 10:10 AM
whchung added a project: Restricted Project.Apr 28 2020, 10:11 AM
ftynse added inline comments.Apr 28 2020, 11:01 AM
mlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
972

I don't see a strong reason to have a cross-product of tests here. The const/non-const-size part is common to both zero and non-zero address space, so it should be sufficient to only have one case where we check for non-zero space support. Otherwise, we risk having to do spurious test updates when an irrelevant part changes (e.g., if I removed the bitcast, I would now have to update twice as many tests that exercise exactly the same behavior)

whchung updated this revision to Diff 260719.Apr 28 2020, 11:59 AM

Address review comments and reduce number of additional tests.

whchung marked an inline comment as done.Apr 28 2020, 12:15 PM

@ftynse Reduced # of additional tests from 4 to 1.

ftynse accepted this revision.Apr 29 2020, 12:55 AM

Thanks!

This revision is now accepted and ready to land.Apr 29 2020, 12:55 AM
This revision was automatically updated to reflect the committed changes.