This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Parser] Use APFloat instead of FloatAttr when parsing DenseElementsAttrs.
ClosedPublic

Authored by rriddle on Feb 19 2020, 12:34 AM.

Details

Summary

DenseElementsAttr stores float values as raw bits internally, so creating attributes just to have them unwrapped is extremely inefficient.

Diff Detail

Event Timeline

rriddle created this revision.Feb 19 2020, 12:34 AM
jpienaar accepted this revision.Feb 19 2020, 7:45 AM

A benchmark showing impact would be nice ;-)

This revision is now accepted and ready to land.Feb 19 2020, 7:45 AM

A benchmark showing impact would be nice ;-)

We don't really have any open benchmarks to run at this point which is unfortunate. Though internally this knocked about 17 seconds off of parsing a .mlir blob with a large number of floating point constants.

This revision was automatically updated to reflect the committed changes.