This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Allow promotion to use callbacks for alloc/dealloc/copies.
ClosedPublic

Authored by mravishankar on May 21 2020, 12:34 AM.

Details

Summary

Add options to LinalgPromotion to use callbacks for implementating the
allocation, deallocation of buffers used for the promoted subviews,
and to copy data into and from the original subviews to the allocated
buffers.
Also some misc. cleanup of the code.

Depends On D80188

Diff Detail

Event Timeline

mravishankar created this revision.May 21 2020, 12:34 AM
nicolasvasilache accepted this revision.May 26 2020, 3:22 AM

Thanks Mahesh!

mlir/lib/Dialect/Linalg/Transforms/Promotion.cpp
144

Could we have defaultAllocBufferCallback, ... callbacks exposed, drop the optional and drop the special if/else casing in the impl?

mlir/test/Dialect/Linalg/promotion_options.mlir
34

nit: newline

This revision is now accepted and ready to land.May 26 2020, 3:22 AM
mravishankar marked an inline comment as done.

Addressing comments

This revision was automatically updated to reflect the committed changes.