Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix removal global dialect registry #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 2 additions & 3 deletions sair_opt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ int main(int argc, char **argv) {
llvm::InitLLVM init(argc, argv);

// Register any pass manager command line options.
mlir::registerAllDialects();
mlir::registerAllPasses();
sair::RegisterSairDialect();
sair::RegisterSairPasses();
mlir::registerPassManagerCLOptions();
mlir::PassPipelineCLParser passPipeline("", "MLIR passes to run");
Expand All @@ -84,7 +82,8 @@ int main(int argc, char **argv) {
}

mlir::DialectRegistry registry;
mlir::getGlobalDialectRegistry().appendTo(registry);
sair::RegisterSairDialect(registry);
mlir::registerAllDialects(registry);
return mlir::failed(
mlir::MlirOptMain(outputFile->os(), std::move(inputFile), passPipeline,
registry, split_input_file, verify_diagnostics,
Expand Down
4 changes: 3 additions & 1 deletion sair_registration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ void sair::RegisterSairPasses() {
[](llvm::function_ref<void(const mlir::detail::PassOptions &)>) {});
}

void sair::RegisterSairDialect() { mlir::registerDialect<sair::SairDialect>(); }
void sair::RegisterSairDialect(mlir::DialectRegistry &registry) {
registry.insert<sair::SairDialect>();
}
6 changes: 4 additions & 2 deletions sair_registration.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@

#ifndef SAIR_SAIR_REGISTRATION_H_
#define SAIR_SAIR_REGISTRATION_H_

namespace mlir {
class DialectRegistry;
}
namespace sair {
// Registers Sair dialect with MLIR.
void RegisterSairDialect();
void RegisterSairDialect(mlir::DialectRegistry &registry);

// Registers all Sair passes with MLIR.
void RegisterSairPasses();
Expand Down