[mlir] Reintroduce API for creating operations with a DictionaryAttr
authorJeff Niu <jeff@modular.com>
Thu, 16 Feb 2023 18:27:10 +0000 (10:27 -0800)
committerJeff Niu <jeff@modular.com>
Fri, 17 Feb 2023 18:07:53 +0000 (10:07 -0800)
commitf25cfd339a8024f9abf787713d07b687384dd59b
treeba0476bbef15136ccac3587cc780a42b49f384d9
parentbe83a4b257c8f0dfd74a659261a544483c5df9af
[mlir] Reintroduce API for creating operations with a DictionaryAttr

This patch reintroduces an API to create operations with a pre-existing
DictionaryAttr. This API does not populate the attributes with any
default attributes the operation may have, like the API that takes a
NamedAttrList does. NamedAttrList is effective at not re-hashing the
attributes if no default attributes were added, but this new API speeds
up clone-heavy workloads slightly (~5%).

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D144204
mlir/include/mlir/IR/Operation.h
mlir/lib/IR/Operation.cpp