From 3dab9056f0606903c7a3459f0167eedd7e081edb Mon Sep 17 00:00:00 2001 From: Sean Silva Date: Wed, 4 Nov 2020 14:14:46 -0800 Subject: [PATCH] Bump llvm-project to eb8d386d513bf4243d0adb814d862af25b8c4e2f Two changes: - no more "verifyPasses" constructor arg for PassManager - OpPassManager defaults to requiring explicit "nest" calls when created via the C++ API. The behavior upstream for mlir-opt still obeys the "implicit" mode, so I just slapped that onto all our pass managers. I pinged https://reviews.llvm.org/D90671 to get a signal for whether we are expected to migrate to explicit mode. If so, I'll do that too later. --- external/llvm-project | 2 +- include/npcomp/Python/MlirPass.h | 6 ++++-- tools/mnist-playground/mnist-playground.cpp | 2 +- tools/npcomp-run-mlir/npcomp-run-mlir.cpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/external/llvm-project b/external/llvm-project index 773ad135a..eb8d386d5 160000 --- a/external/llvm-project +++ b/external/llvm-project @@ -1 +1 @@ -Subproject commit 773ad135a30dbe0f969086e3ed518ab17502e9f5 +Subproject commit eb8d386d513bf4243d0adb814d862af25b8c4e2f diff --git a/include/npcomp/Python/MlirPass.h b/include/npcomp/Python/MlirPass.h index 9ed7de593..31ece6068 100644 --- a/include/npcomp/Python/MlirPass.h +++ b/include/npcomp/Python/MlirPass.h @@ -18,8 +18,10 @@ namespace mlir { struct PyPassManager { PyPassManager(std::shared_ptr context, bool verifyModules) - : passManager(&context->context, verifyModules), - context(std::move(context)) {} + : passManager(&context->context, OpPassManager::Nesting::Implicit), + context(std::move(context)) { + passManager.enableVerifier(verifyModules); + } static void bind(py::module m); PassManager passManager; diff --git a/tools/mnist-playground/mnist-playground.cpp b/tools/mnist-playground/mnist-playground.cpp index 417161aaa..94e3db456 100644 --- a/tools/mnist-playground/mnist-playground.cpp +++ b/tools/mnist-playground/mnist-playground.cpp @@ -51,7 +51,7 @@ createJITModule(std::string mlirFile, mlir::DialectRegistry ®istry, ModuleOp module = *moduleRef; // Compile. - PassManager pm(module.getContext(), /*verifyPasses=*/true); + PassManager pm(module.getContext(), OpPassManager::Nesting::Implicit); applyPassManagerCLOptions(pm); refback::JITModule::buildBackendCompilationPipeline(pm, optimize); if (failed(pm.run(module))) diff --git a/tools/npcomp-run-mlir/npcomp-run-mlir.cpp b/tools/npcomp-run-mlir/npcomp-run-mlir.cpp index 3f7b84a31..904e90ede 100644 --- a/tools/npcomp-run-mlir/npcomp-run-mlir.cpp +++ b/tools/npcomp-run-mlir/npcomp-run-mlir.cpp @@ -128,7 +128,7 @@ Error compileAndRun(std::string mlirFile, mlir::DialectRegistry ®istry, ModuleOp module = *moduleRef; // Compile. - PassManager pm(module.getContext(), /*verifyPasses=*/true); + PassManager pm(module.getContext(), OpPassManager::Nesting::Implicit); applyPassManagerCLOptions(pm); refback::JITModule::buildBackendCompilationPipeline(pm, optimize); if (failed(pm.run(module))) {