This is an archive of the discontinued LLVM Phabricator instance.

[mlir][memref] Bufferize memref.tensor_store op
ClosedPublic

Authored by springerm on Feb 15 2023, 12:55 AM.

Details

Summary

This change adds the BufferizableOpInterface implementation for memref.tensor_store.

Depends On: D144022

Diff Detail

Event Timeline

springerm created this revision.Feb 15 2023, 12:55 AM
springerm requested review of this revision.Feb 15 2023, 12:55 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2023, 12:55 AM
nicolasvasilache accepted this revision.Feb 15 2023, 2:04 AM
nicolasvasilache added inline comments.
mlir/lib/Dialect/MemRef/Transforms/BufferizableOpInterfaceImpl.cpp
49

Can we use a linalg.copy here?
Experience shows that going to memref.copy prematurely can yield very bad perf.
There are simple woarkarounds like rewriting a memref.copy into a linalg.copy but it is better to avoid lowering prematurely.

mlir/test/Dialect/MemRef/bufferize.mlir
12

nit:nl

This revision is now accepted and ready to land.Feb 15 2023, 2:04 AM
This revision was automatically updated to reflect the committed changes.
springerm marked an inline comment as done.
springerm added inline comments.Feb 15 2023, 6:29 AM
mlir/lib/Dialect/MemRef/Transforms/BufferizableOpInterfaceImpl.cpp
49

I changed it options.createMemCpy then it's using whatever "copy" callback we configure the bufferization with.

springerm marked an inline comment as done.Feb 15 2023, 6:29 AM