Remove MLIR C-API explicit registration of standard ops.

* Added mlirRegisterAllDialects() to the python API until a more complete registration design emerges for it.

Differential Revision: https://reviews.llvm.org/D88155
This commit is contained in:
Stella Laurenzo
2020-09-23 08:13:30 -07:00
parent a6ae695017
commit b522f09d96
2 changed files with 2 additions and 5 deletions

View File

@@ -9,6 +9,7 @@
#include "IRModules.h"
#include "PybindUtils.h"
#include "mlir-c/Registration.h"
#include "mlir-c/StandardAttributes.h"
#include "mlir-c/StandardTypes.h"
#include "llvm/ADT/SmallVector.h"
@@ -454,6 +455,7 @@ PyMlirContext::~PyMlirContext() {
PyMlirContext *PyMlirContext::createNewContextForInit() {
MlirContext context = mlirContextCreate();
mlirRegisterAllDialects(context);
return new PyMlirContext(context);
}

View File

@@ -10,7 +10,6 @@
#include "mlir/CAPI/IR.h"
#include "mlir/CAPI/Utils.h"
#include "mlir/Dialect/StandardOps/IR/Ops.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/Module.h"
@@ -26,10 +25,6 @@ using namespace mlir;
MlirContext mlirContextCreate() {
auto *context = new MLIRContext(/*loadAllDialects=*/false);
// TODO: Come up with a story for which dialects to load into the context
// and do not expand this beyond StandardOps until done so. This is loaded
// by default here because it is hard to make progress otherwise.
context->loadDialect<StandardOpsDialect>();
return wrap(context);
}