[mlir] Split out Python bindings for dialects into separate libs

Historically, the bindings for the Linalg dialect were included into the
"core" bindings library because they depended on the C++ implementation
of the "core" bindings. The other dialects followed the pattern. Now
that this dependency is gone, split out each dialect into a separate
Python extension library.

Depends On D116649, D116605

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D116662
This commit is contained in:
Alex Zinenko
2022-01-05 11:21:21 +01:00
parent 6e4bbbfcc8
commit 95ddbed9b7
12 changed files with 154 additions and 118 deletions

View File

@@ -10,7 +10,6 @@
#include "PybindUtils.h"
#include "Dialects.h"
#include "Globals.h"
#include "IRModule.h"
#include "Pass.h"
@@ -100,13 +99,4 @@ PYBIND11_MODULE(_mlir, m) {
auto passModule =
m.def_submodule("passmanager", "MLIR Pass Management Bindings");
populatePassManagerSubmodule(passModule);
// Define and populate dialect submodules.
auto dialectsModule = m.def_submodule("dialects");
auto linalgModule = dialectsModule.def_submodule("linalg");
populateDialectLinalgSubmodule(linalgModule);
populateDialectSparseTensorSubmodule(
dialectsModule.def_submodule("sparse_tensor"), irModule);
populateDialectQuantSubmodule(dialectsModule.def_submodule("quant"),
irModule);
}