mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 01:58:44 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user