diff --git a/mlir/lib/Bindings/Python/Pass.cpp b/mlir/lib/Bindings/Python/Pass.cpp --- a/mlir/lib/Bindings/Python/Pass.cpp +++ b/mlir/lib/Bindings/Python/Pass.cpp @@ -85,7 +85,7 @@ [](const std::string &pipeline, DefaultingPyMlirContext context) { MlirPassManager passManager = mlirPassManagerCreate(context->get()); PyPrintAccumulator errorMsg; - MlirLogicalResult status = mlirOpPassManagerAddPipeline( + MlirLogicalResult status = mlirParsePassPipeline( mlirPassManagerGetAsOpPassManager(passManager), mlirStringRefCreate(pipeline.data(), pipeline.size()), errorMsg.getCallback(), errorMsg.getUserData()); diff --git a/mlir/test/Integration/Dialect/SparseTensor/python/tools/sparse_compiler.py b/mlir/test/Integration/Dialect/SparseTensor/python/tools/sparse_compiler.py --- a/mlir/test/Integration/Dialect/SparseTensor/python/tools/sparse_compiler.py +++ b/mlir/test/Integration/Dialect/SparseTensor/python/tools/sparse_compiler.py @@ -13,7 +13,7 @@ """Sparse compiler class for compiling and building MLIR modules.""" def __init__(self, options: str, opt_level: int, shared_libs: Sequence[str]): - pipeline = f'sparse-compiler{{{options} reassociate-fp-reductions=1 enable-index-optimizations=1}}' + pipeline = f'builtin.module(sparse-compiler{{{options} reassociate-fp-reductions=1 enable-index-optimizations=1}})' self.pipeline = pipeline self.opt_level = opt_level self.shared_libs = shared_libs diff --git a/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_sparse_compiler.py b/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_sparse_compiler.py --- a/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_sparse_compiler.py +++ b/mlir/test/Integration/Dialect/SparseTensor/taco/tools/mlir_sparse_compiler.py @@ -16,7 +16,7 @@ """Sparse compiler class for compiling and building MLIR modules.""" def __init__(self, options: str, opt_level: int, shared_libs: Sequence[str]): - pipeline = f'sparse-compiler{{{options} reassociate-fp-reductions=1 enable-index-optimizations=1}}' + pipeline = f'builtin.module(sparse-compiler{{{options} reassociate-fp-reductions=1 enable-index-optimizations=1}})' self.pipeline = pipeline self.opt_level = opt_level self.shared_libs = shared_libs diff --git a/mlir/test/python/dialects/async_dialect.py b/mlir/test/python/dialects/async_dialect.py --- a/mlir/test/python/dialects/async_dialect.py +++ b/mlir/test/python/dialects/async_dialect.py @@ -11,7 +11,7 @@ def testAsyncPass(): with Context() as context: - PassManager.parse('async-to-async-runtime') + PassManager.parse('any(async-to-async-runtime)') print('SUCCESS') # CHECK-LABEL: testAsyncPass diff --git a/mlir/test/python/dialects/gpu.py b/mlir/test/python/dialects/gpu.py --- a/mlir/test/python/dialects/gpu.py +++ b/mlir/test/python/dialects/gpu.py @@ -11,7 +11,7 @@ def testGPUPass(): with Context() as context: - PassManager.parse('gpu-kernel-outlining') + PassManager.parse('any(gpu-kernel-outlining)') print('SUCCESS') # CHECK-LABEL: testGPUPass diff --git a/mlir/test/python/dialects/sparse_tensor/passes.py b/mlir/test/python/dialects/sparse_tensor/passes.py --- a/mlir/test/python/dialects/sparse_tensor/passes.py +++ b/mlir/test/python/dialects/sparse_tensor/passes.py @@ -16,7 +16,7 @@ @run def testSparseTensorPass(): with Context() as context: - PassManager.parse('sparsification') - PassManager.parse('sparse-tensor-conversion') + PassManager.parse('any(sparsification)') + PassManager.parse('any(sparse-tensor-conversion)') # CHECK: SUCCESS print('SUCCESS') diff --git a/mlir/test/python/execution_engine.py b/mlir/test/python/execution_engine.py --- a/mlir/test/python/execution_engine.py +++ b/mlir/test/python/execution_engine.py @@ -63,7 +63,7 @@ def lowerToLLVM(module): pm = PassManager.parse( - "convert-complex-to-llvm,convert-memref-to-llvm,convert-func-to-llvm,reconcile-unrealized-casts") + "builtin.module(convert-complex-to-llvm,convert-memref-to-llvm,convert-func-to-llvm,reconcile-unrealized-casts)") pm.run(module) return module diff --git a/mlir/test/python/integration/dialects/linalg/opsrun.py b/mlir/test/python/integration/dialects/linalg/opsrun.py --- a/mlir/test/python/integration/dialects/linalg/opsrun.py +++ b/mlir/test/python/integration/dialects/linalg/opsrun.py @@ -192,10 +192,10 @@ mod = Module.parse("\n".join([str(op) for op in ops]) + boilerplate) pm = PassManager.parse( - "func.func(convert-linalg-to-loops, lower-affine, " + + "builtin.module(func.func(convert-linalg-to-loops, lower-affine, " + "convert-math-to-llvm, convert-scf-to-cf, arith-expand, memref-expand), " + "convert-vector-to-llvm, convert-memref-to-llvm, convert-func-to-llvm," + - "reconcile-unrealized-casts") + "reconcile-unrealized-casts)") pm.run(mod) return mod diff --git a/mlir/test/python/pass_manager.py b/mlir/test/python/pass_manager.py --- a/mlir/test/python/pass_manager.py +++ b/mlir/test/python/pass_manager.py @@ -44,7 +44,7 @@ # A registered pass should parse successfully. pm = PassManager.parse("builtin.module(func.func(print-op-stats{json=false}))") - # CHECK: Roundtrip: builtin.module(builtin.module(func.func(print-op-stats{json=false}))) + # CHECK: Roundtrip: builtin.module(func.func(print-op-stats{json=false})) log("Roundtrip: ", pm) run(testParseSuccess) @@ -53,7 +53,7 @@ def testParseFail(): with Context(): try: - pm = PassManager.parse("unknown-pass") + pm = PassManager.parse("any(unknown-pass)") except ValueError as e: # CHECK: ValueError exception: MLIR Textual PassPipeline Parser:1:1: error: # CHECK-SAME: 'unknown-pass' does not refer to a registered pass or pass pipeline @@ -83,7 +83,7 @@ # CHECK-LABEL: TEST: testRun def testRunPipeline(): with Context(): - pm = PassManager.parse("print-op-stats{json=false}") + pm = PassManager.parse("builtin.module(print-op-stats{json=false})") module = Module.parse(r"""func.func @successfulParse() { return }""") pm.run(module) # CHECK: Operations encountered: