This is an archive of the discontinued LLVM Phabricator instance.

[mlir][bufferize] Merge tensor-constant-bufferize into arith-bufferize
ClosedPublic

Authored by springerm on Jan 28 2022, 9:21 AM.

Details

Summary

The bufferization of arith.constant ops is also switched over to BufferizableOpInterface-based bufferization. The old implementation is deleted. Both implementations utilize GlobalCreator, now renamed to just getGlobalFor.

GlobalCreator no longer maintains a set of all created allocations to avoid duplicate allocations of the same constant. Instead, getGlobalFor scans the module to see if there is already a global allocation with the same constant value.

For compatibility reasons, it is still possible to create a pass that bufferizes only arith.constant. This pass (createConstantBufferizePass) could be deleted once all users were switched over to One-Shot bufferization.

Diff Detail

Event Timeline

springerm created this revision.Jan 28 2022, 9:21 AM
springerm requested review of this revision.Jan 28 2022, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2022, 9:21 AM
pifon2a accepted this revision.Jan 30 2022, 3:57 AM
This revision is now accepted and ready to land.Jan 30 2022, 3:57 AM

Can you run $ git grep tensor-constant-bufferize mlir and make sure there are no instances left?

mlir/test/Dialect/SparseTensor/sparse_lower_col.mlir