Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/src/iree/compiler/API/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ set(CMAKE_PLATFORM_NO_VERSIONED_SONAME 1)
declare_mlir_python_sources(IREECompilerAPIPythonSources
ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/iree/compiler"
SOURCES
_mlir_libs/_site_initialize_0.py
transforms/ireec.py
)
declare_mlir_python_sources(IREECompilerAPIPythonExtensions)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Note that this does some load time, once-only init.
from . import _ireecTransforms


def register_dialects(registry):
# TODO: Convert the below context_init_hook to be DialectRegistry
# based and use it here.
pass


def context_init_hook(context):
_ireecTransforms.register_all_dialects(context)

Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@

# Test the compiler API.
with ir.Context() as ctx:
ireec.register_all_dialects(ctx)

input_module = ir.Module.parse(r"""
builtin.module {
func.func @fabs(%arg0: tensor<1x4xf32>, %arg1: tensor<4x1xf32>) -> tensor<4x4xf32> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include "mlir-c/IR.h"
#include "mlir-c/Pass.h"
#include "mlir-c/Registration.h"

#ifdef __cplusplus
extern "C" {
Expand Down
3 changes: 0 additions & 3 deletions llvm-external-projects/iree-dialects/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,12 @@ declare_mlir_python_extension(IREEDialectsPythonExtensions.Main
################################################################################

set(_source_components
# TODO: Core is now implicitly building/registering all dialects, increasing
# build burden by ~5x. Make it stop.
MLIRPythonSources.Core
MLIRPythonSources.Dialects.builtin
MLIRPythonSources.Dialects.cf
MLIRPythonSources.Dialects.func
MLIRPythonSources.Dialects.pdl
MLIRPythonSources.Dialects.transform
MLIRPythonSources.Passes
IREEDialectsPythonSources
IREEDialectsPythonExtensions
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "mlir-c/BuiltinAttributes.h"
#include "mlir-c/BuiltinTypes.h"
#include "mlir-c/Diagnostics.h"
#include "mlir-c/Registration.h"
#include "mlir-c/IR.h"
#include "mlir/Bindings/Python/PybindAdaptors.h"

namespace py = pybind11;
Expand Down