This is an archive of the discontinued LLVM Phabricator instance.

[mlir][arith] Add arith.constant materialization helper
ClosedPublic

Authored by rkayaith on Apr 16 2023, 9:10 PM.

Details

Summary

This adds arith::ConstantOp::materialize, which builds a constant from
an attribute and type only if it would result in a valid op. This is
useful for dialect materializeConstant hooks, and allows for removing
the previous Attribute, Type builder which was only used during
materialization.

Diff Detail

Event Timeline

rkayaith created this revision.Apr 16 2023, 9:10 PM
rkayaith published this revision for review.Apr 16 2023, 10:34 PM
mravishankar resigned from this revision.Apr 17 2023, 11:10 AM
rriddle accepted this revision.Apr 17 2023, 12:59 PM
This revision is now accepted and ready to land.Apr 17 2023, 12:59 PM
rkayaith edited the summary of this revision. (Show Details)Apr 20 2023, 1:31 PM
This revision was automatically updated to reflect the committed changes.