This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][python bindings] Add `register_value_builder` that can be used to wrap results of ops automatically.
DraftPublic

Authored by makslevental on May 11 2023, 6:39 PM.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
ftynse
Summary

This diff adds functionality akin to register_attribute_builder but for Values, i.e., users can define functions that map to Python classes that wrap results from ops. Currently the selection is done in a metaclass using a regex match on the stringified type of the value but safer ways are possible (see this diff.

Diff Detail