Page MenuHomePhabricator

Add Location, Region and Block to MLIR Python bindings.
ClosedPublic

Authored by stellaraccident on Aug 26 2020, 11:50 PM.

Details

Summary
  • This is just enough to create regions/blocks and iterate over them.
  • Does not yet implement the preferred iteration strategy (python pseudo containers).
  • Refinements need to come after doing basic mappings of operations and values so that the whole hierarchy can be used.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptAug 26 2020, 11:50 PM
stellaraccident requested review of this revision.Aug 26 2020, 11:50 PM
jpienaar accepted this revision.Aug 28 2020, 2:48 PM

Looks good, thanks

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

this region? or Block and Region ?

This revision is now accepted and ready to land.Aug 28 2020, 2:48 PM
rriddle added inline comments.Aug 28 2020, 2:54 PM
mlir/lib/Bindings/Python/IRModules.h
72

nit: Can you drop the trivial braces here and below?

mlir/lib/CAPI/IR/IR.cpp
351

Accidental m here.

stellaraccident marked 3 inline comments as done.

Comments and rebase.

Addressed comments. Thanks!

This revision was landed with ongoing or failed builds.Aug 28 2020, 3:29 PM
This revision was automatically updated to reflect the committed changes.
ftynse added inline comments.Aug 31 2020, 12:48 AM
mlir/lib/Bindings/Python/IRModules.cpp
625

Hmm, didn't we want to make regions/blocks iterable with pseudo-containers, like for block in region.blocks ?