This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Expose Value hierarchy to Python bindings
ClosedPublic

Authored by ftynse on Oct 20 2020, 2:21 AM.

Details

Summary

Values are ubiquitous in the IR, in particular block argument and operation
results are Values. Define Python classes for BlockArgument, OpResult and their
common ancestor Value. Define pseudo-container classes for lists of block
arguments and operation results, and use these containers to access the
corresponding values in blocks and operations.

Diff Detail

Event Timeline

ftynse created this revision.Oct 20 2020, 2:21 AM
ftynse requested review of this revision.Oct 20 2020, 2:21 AM
stellaraccident accepted this revision.Oct 20 2020, 9:43 AM

Nice!

mlir/lib/Bindings/Python/IRModules.cpp
781

I'm not sure this keep_alive is buying you anything, given the ownership model in use.

mlir/lib/Bindings/Python/IRModules.h
387

Op result values (plural)

This revision is now accepted and ready to land.Oct 20 2020, 9:43 AM
This revision was landed with ongoing or failed builds.Oct 21 2020, 12:52 AM
This revision was automatically updated to reflect the committed changes.