This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Python] Custom python op view wrappers for building and traversing.
ClosedPublic

Authored by stellaraccident on Oct 21 2020, 11:35 PM.

Details

Summary
  • Still rough edges that need more sugar but the bones are there. Notes left in the test case for things that can be improved.
  • Does not actually yield custom OpViews yet for traversing. Will rework that in a followup.

Diff Detail

Event Timeline

stellaraccident requested review of this revision.Oct 21 2020, 11:35 PM

Respond to conversation.

Send for review

stellaraccident retitled this revision from [mlir][Python] DRAFT: Plumbing extension loader in and using it to create custom Dialect class. to [mlir][Python] Custom python op view wrappers for building and traversing..Oct 26 2020, 8:17 PM
stellaraccident edited the summary of this revision. (Show Details)
ftynse accepted this revision.Oct 27 2020, 3:13 AM
ftynse added inline comments.
mlir/lib/Bindings/Python/Globals.h
59

Nit: if the mapping already exists

65

Same nit

72

Nit: "an the"

82

What is the convention for bool values? true = loaded, false = not found, no-value = not attempted?

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

Is this change intentional?

mlir/lib/Bindings/Python/MainModule.cpp
57

Can this ever contain false? If not, we rather want a StringSet<> for this.

This revision is now accepted and ready to land.Oct 27 2020, 3:13 AM
stellaraccident marked 5 inline comments as done.Oct 27 2020, 12:21 PM
stellaraccident added inline comments.
mlir/lib/Bindings/Python/Globals.h
82

Changed to StringSet.

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

Thanks from a previous iteration of the patch where I had to capture the module in the method, but since I've pulled this out to the PyGlobals now, it is unnecessary. Reverted.

mlir/lib/Bindings/Python/MainModule.cpp
57

Thanks. Originally was mapping to the module, removed the mapped value and should have dropped it back to a set then. Done.

stellaraccident marked 2 inline comments as done.

Address comments.

This revision was landed with ongoing or failed builds.Oct 27 2020, 12:29 PM
This revision was automatically updated to reflect the committed changes.