This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferize] Improve analysis of external functions
ClosedPublic

Authored by springerm on Dec 7 2022, 1:56 AM.

Details

Summary

External functions have no body, so they cannot be analyzed. Assume conservatively that each tensor bbArg may be aliasing with each tensor result. Furthermore, assume that each function arg is read and written-to after bufferization. This default behavior can be controlled with bufferization.access (similar to bufferization.memory_layout) in test cases.

Also fix a bug in the dialect attribute verifier, which did not run for region argument attributes.

Diff Detail

Event Timeline

springerm created this revision.Dec 7 2022, 1:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 7 2022, 1:56 AM
springerm requested review of this revision.Dec 7 2022, 1:56 AM
springerm updated this revision to Diff 480936.Dec 7 2022, 8:50 AM

minor improvements

aartbik accepted this revision.Dec 8 2022, 10:12 AM
aartbik added inline comments.
mlir/lib/Dialect/Bufferization/Transforms/OneShotModuleBufferize.cpp
196–218
for (int64_t idx = 0, e = funcOp.getFunctionType().getNumInputs(); idx < e; ++idx) {
This revision is now accepted and ready to land.Dec 8 2022, 10:12 AM
springerm marked an inline comment as done.Dec 9 2022, 5:30 AM
springerm updated this revision to Diff 481607.Dec 9 2022, 5:30 AM

address comments

This revision was landed with ongoing or failed builds.Dec 9 2022, 5:36 AM
This revision was automatically updated to reflect the committed changes.