This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg][bufferize] Fix insertion point InitTensorElimination
ClosedPublic

Authored by springerm on Jan 19 2022, 8:33 AM.

Details

Summary

There was a bug where some of the OpOperands needed in the replacement op were not in scope.

It does not matter where the replacement op is inserted. Any insertion point is OK as long as there are no dominance errors. In the worst case, the newly inserted op will bufferize out-of-place. This is no worse than not eliminating the InitTensorOp at all.

Diff Detail

Event Timeline

springerm created this revision.Jan 19 2022, 8:33 AM
springerm requested review of this revision.Jan 19 2022, 8:33 AM
springerm updated this revision to Diff 401261.Jan 19 2022, 8:37 AM

more comments

mravishankar accepted this revision.Jan 20 2022, 9:15 AM

Dont have a major issue with this patch, but I am not convinced the bufferization needs to go through these contortions to eliminate init tensor op. It is perfectly valid to say "input is expected in some form for optimal in-place bufferization"

This revision is now accepted and ready to land.Jan 20 2022, 9:15 AM