File tree Expand file tree Collapse file tree 5 files changed +14
-5
lines changed
Expand file tree Collapse file tree 5 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -136,8 +136,10 @@ NB_MODULE(_mlir, m) {
136136 populateRewriteSubmodule (rewriteModule);
137137
138138 // Define and populate PassManager submodule.
139- auto passModule =
139+ auto passManagerModule =
140140 m.def_submodule (" passmanager" , " MLIR Pass Management Bindings" );
141- populatePassManagerSubmodule (passModule);
142- populatePassSubmodule (passModule);
141+ populatePassManagerSubmodule (passManagerModule);
142+ auto passesModule =
143+ m.def_submodule (" passes" , " MLIR Pass Infrastructure Bindings" );
144+ populatePassSubmodule (passesModule);
143145}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ namespace {
2626// A base class for defining passes in Python
2727// Users are expected to subclass this and implement the `run` method, e.g.
2828// ```
29- // class MyPass(mlir.passmanager. Pass):
29+ // class MyPass(Pass):
3030// def __init__(self):
3131// super().__init__("MyPass", ..)
3232// # other init stuff..
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ declare_mlir_python_sources(MLIRPythonSources.Core.Python
2020 SOURCES
2121 _mlir_libs/__init__.py
2222 ir.py
23+ passes.py
2324 passmanager.py
2425 rewrite.py
2526 dialects/_ods_common.py
Original file line number Diff line number Diff line change 1+ # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
2+ # See https://llvm.org/LICENSE.txt for license information.
3+ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+ from ._mlir_libs ._mlir .passes import *
Original file line number Diff line number Diff line change 33import gc , sys
44from mlir .ir import *
55from mlir .passmanager import *
6+ from mlir .passes import *
67from mlir .dialects .builtin import ModuleOp
78from mlir .dialects import pdl
89from mlir .rewrite import *
@@ -51,13 +52,13 @@ def rew():
5152def testCustomPass ():
5253 with Context ():
5354 pdl_module = make_pdl_module ()
55+ frozen = PDLModule (pdl_module ).freeze ()
5456
5557 class CustomPass (Pass ):
5658 def __init__ (self ):
5759 super ().__init__ ("CustomPass" , op_name = "builtin.module" )
5860
5961 def run (self , m ):
60- frozen = PDLModule (pdl_module ).freeze ()
6162 apply_patterns_and_fold_greedily_with_op (m , frozen )
6263
6364 module = ModuleOp .parse (
You can’t perform that action at this time.
0 commit comments