This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Populate default attributes on op creation
ClosedPublic

Authored by jpienaar on Aug 1 2022, 9:42 AM.

Details

Summary

Default attributes were only handled by ODS accessors generated with the
intention that these behave as if set attributes. This addresses the
long standing TODO to address this inconsistency. Moving the
initialization to construction vs every access. Removing need for
duplicated default attribute population in python bindings.

Switch OpenMP ones to optional attribute with default as the currently
set default values are not legal.

Switched LinAlg generated ones to optional attribute with default as its
quite widely used and unclear where it falls on two different
interpretations.

Diff Detail

Event Timeline

jpienaar created this revision.Aug 1 2022, 9:42 AM
jpienaar requested review of this revision.Aug 1 2022, 9:42 AM
rriddle accepted this revision.Aug 10 2022, 10:42 AM

LG, did you see any compile time regressions of any kind? Just making sure that our current way of setting the attributes isn't slow for some reason.

This revision is now accepted and ready to land.Aug 10 2022, 10:42 AM

LG, did you see any compile time regressions of any kind? Just making sure that our current way of setting the attributes isn't slow for some reason.

I did not no. Most default instances were the simple/empty case though. This should result in no more to less attribute creation unless an accessor is never used (and we could further improve it in future by making the default be cached per op type).

This revision was landed with ongoing or failed builds.Aug 22 2022, 4:49 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptAug 22 2022, 4:49 PM