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%).
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/IR/Operation.h | ||
---|---|---|
86 | I'm a bit concerned about the discrepancy of behavior between the two APIs with respect to default attributes. We have now two method with the same name, differing only by taking a NamedAttrList vs a DictionaryAttr, but with a subtle difference that isn't well conveyed in the API. I don't believe it is common in the code base that we use NamedAttrList vs a DictionaryAttr to signal semantics difference, do we? |
mlir/include/mlir/IR/Operation.h | ||
---|---|---|
86 |
It isn't. Would it be better to rename the methods? createWithDefaultAttrs for the former? |
I'm a bit concerned about the discrepancy of behavior between the two APIs with respect to default attributes. We have now two method with the same name, differing only by taking a NamedAttrList vs a DictionaryAttr, but with a subtle difference that isn't well conveyed in the API.
I don't believe it is common in the code base that we use NamedAttrList vs a DictionaryAttr to signal semantics difference, do we?