This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add check for ViewLikeOpInterface that creates additional aliases.
ClosedPublic

Authored by dfki-jugr on Jul 2 2020, 6:23 AM.

Details

Summary

ViewLikeOpInterfaces introduce new aliases that need to be added to the alias
list. This is necessary to place deallocs in the right positions.

Diff Detail

Event Timeline

dfki-jugr created this revision.Jul 2 2020, 6:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2020, 6:23 AM
pifon2a added inline comments.Jul 2 2020, 6:35 AM
mlir/lib/Transforms/BufferPlacement.cpp
149

What would be the difference between aliasing-operation-effects interface and already existing ViewLikeOpInterface ?

bondhugula added inline comments.
mlir/lib/Transforms/BufferPlacement.cpp
149

Nit: memRefCastOp.source()

herhut added a comment.Jul 2 2020, 7:58 AM

Thanks for trying this! As @pifon suggests, you could use the ViewLikeOpInterface today and cover some ops (like ViewOp and SubviewOp) in std. That would definitely be worth adding. So please rewrite using that interface and change the test to use SubviewOp. Then this can land!

mlir/lib/Transforms/BufferPlacement.cpp
149

Maybe we should evolve ViewLikeOpInterface in that direction. @nicolasvasilache Would you say that memref_cast should implement that interface? Or do you have some other semantic meaning in mind?

mlir/test/Transforms/buffer-placement.mlir
929

Should the others be CHECK-NEXT too?

pifon2a added inline comments.Jul 2 2020, 8:09 AM
mlir/lib/Transforms/BufferPlacement.cpp
149

Would it make sense to add ViewLikeOpInterface to MemrefcastOp?

dfki-jugr updated this revision to Diff 275347.Jul 3 2020, 3:39 AM
dfki-jugr marked 2 inline comments as done.

Changed from a specialized MemRefCastOp version to a more general ViewLikeOpInterface version.
Adapt test case, since MemRefCastOp is currently not a ViewLikeOp.

dfki-jugr retitled this revision from [mlir] Add check for MemRefCastOp that creates additional aliases. to [mlir] Add check for ViewLikeOpInterface that creates additional aliases..Jul 3 2020, 4:44 AM
dfki-jugr edited the summary of this revision. (Show Details)
herhut accepted this revision.Jul 3 2020, 6:00 AM

Looks good to me. Thanks!

This revision is now accepted and ready to land.Jul 3 2020, 6:00 AM
This revision was automatically updated to reflect the committed changes.