This is an archive of the discontinued LLVM Phabricator instance.

Implement python iteration over the operation/region/block hierarchy.
ClosedPublic

Authored by stellaraccident on Sep 19 2020, 10:05 PM.

Details

Summary
  • Removes the half-completed prior attempt at region/block mutation in favor of new approach to ownership.
  • Will re-add mutation more correctly in a follow-on.
  • Eliminates the detached state on blocks and regions, simplifying the ownership hierarchy.
  • Adds both iterator and index based access at each level.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptSep 19 2020, 10:05 PM
stellaraccident requested review of this revision.Sep 19 2020, 10:05 PM
ftynse accepted this revision.Sep 23 2020, 4:31 AM

Looks great!

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

Nit: getParentOperation?

272–273

Typo: Regions->blocks.

278

Should we also have a similar check for regions?

This revision is now accepted and ready to land.Sep 23 2020, 4:31 AM
stellaraccident marked 3 inline comments as done.

Address comments.

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

Doesn't hurt - I was rather scattershot in adding asserts while debugging and missed making this consistent.

Push just the one change.

This revision was landed with ongoing or failed builds.Sep 23 2020, 7:59 AM
This revision was automatically updated to reflect the committed changes.