Page MenuHomePhabricator

[mlir] Add linalg.fill bufferization conversion
ClosedPublic

Authored by ezhulenev on Mar 15 2021, 4:52 PM.

Details

Summary

BufferizeAnyLinalgOp fails because FillOp is not a LinalgGenericOp and it fails while reading operand sizes attribute.

Diff Detail

Event Timeline

ezhulenev created this revision.Mar 15 2021, 4:52 PM
ezhulenev requested review of this revision.Mar 15 2021, 4:52 PM
ezhulenev edited the summary of this revision. (Show Details)Mar 15 2021, 4:54 PM
ezhulenev added a reviewer: mravishankar.
ezhulenev edited the summary of this revision. (Show Details)

FillOp abides by the structured op interface, what is annoying here is there is no adaptor for an interface.
Here is what I am currently iterating on, which does not use the conversion infrastructure: https://github.com/google/iree-llvm-sandbox/blob/main/runners/LinalgComprehensiveBufferizePass.cpp#L1043.

I guess this is fine in the meantime but I would be very cautious on depending on anything related to core linalg bufferization: it will likely break in a bunch of ways before it gets better (see e.g. https://llvm.discourse.group/t/properly-using-bufferization-related-passes/2913).

nicolasvasilache accepted this revision.Mar 18 2021, 1:00 PM
This revision is now accepted and ready to land.Mar 18 2021, 1:00 PM
This revision was automatically updated to reflect the committed changes.

Note that tensor_to_memref is now memref.buffer_cast and tensor_load should be memref.tesnor_load.