This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Introduce OptionalAttrWithDefault
ClosedPublic

Authored by jpienaar on Jul 27 2022, 9:20 PM.

Details

Summary

Currently DefaultValuedAttr is confusingly cactually default valued &
optional but that was an artifact of development and longstanding TODO
to address. Add new attribute that matches this behavior for cases where
that is actually the desired behavior before addressing TODO.

Diff Detail

Event Timeline

jpienaar created this revision.Jul 27 2022, 9:20 PM
jpienaar requested review of this revision.Jul 27 2022, 9:20 PM
rriddle accepted this revision.Jul 28 2022, 2:05 PM

Typo in the description: cactually

Also, if I'm reading it right, this is an incremental step to fixing DefaultValuedAttr>

mlir/include/mlir/IR/OpBase.td
972

Would DefaultValuedOptionalAttr be more inline with how we name other things?

This revision is now accepted and ready to land.Jul 28 2022, 2:05 PM
jpienaar updated this revision to Diff 448443.Jul 28 2022, 2:41 PM
jpienaar marked an inline comment as done.

Rename to DefaultValuedOptionalAttr

This revision was landed with ongoing or failed builds.Jul 28 2022, 2:43 PM
This revision was automatically updated to reflect the committed changes.