This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Remove the MutableDictionaryAttr class
ClosedPublic

Authored by rriddle on Dec 16 2020, 8:34 PM.

Details

Summary

This class used to serve a few useful purposes:

  • Allowed containing a null DictionaryAttr
  • Provided some simple mutable API around a DictionaryAttr

The first of which is no longer an issue now that there is much better caching support for attributes in general, and a cache in the context for empty dictionaries. The second results in more trouble than it's worth because it mutates the internal dictionary on every action, leading to a potentially large number of dictionary copies. NamedAttrList is a much better alternative for the second use case, and should be modified as needed to better fit it's usage as a DictionaryAttrBuilder.

Diff Detail

Event Timeline

rriddle created this revision.Dec 16 2020, 8:34 PM
rriddle requested review of this revision.Dec 16 2020, 8:34 PM
mehdi_amini accepted this revision.Dec 16 2020, 9:18 PM
This revision is now accepted and ready to land.Dec 16 2020, 9:18 PM
jpienaar accepted this revision.Dec 17 2020, 5:30 AM

Thanks!

mlir/include/mlir/IR/FunctionSupport.h
304

Is result a nullptr or just empty/not modified?

372

Same as above

This revision was landed with ongoing or failed builds.Dec 17 2020, 5:19 PM
This revision was automatically updated to reflect the committed changes.