This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Switch create to use NamedAttrList&&
ClosedPublic

Authored by jpienaar on Jul 11 2022, 5:42 PM.

Details

Summary

Avoids needing the two parallel functions as NamedAttrList already takes care
of caching/passing through DictionaryAttr. Most cases were already supported
via implicit conversion, but add a few more cases for NamedAttrList that would
have required double implicit conversion.

Diff Detail

Event Timeline

jpienaar created this revision.Jul 11 2022, 5:42 PM
jpienaar requested review of this revision.Jul 11 2022, 5:42 PM
rriddle added inline comments.Jul 11 2022, 11:32 PM
mlir/include/mlir/IR/OperationSupport.h
493–499

Let's please avoid this, can we just have a templated range method instead?

jpienaar updated this revision to Diff 444024.Jul 12 2022, 11:24 AM

Use more generic templated constructor for NamedAttrList

mlir/include/mlir/IR/OperationSupport.h
493–499

Like so?

rriddle accepted this revision.Jul 12 2022, 1:11 PM
rriddle added inline comments.
mlir/include/mlir/IR/OperationSupport.h
493–499

Yep, thanks.

This revision is now accepted and ready to land.Jul 12 2022, 1:11 PM
This revision was automatically updated to reflect the committed changes.