blob: c86c8b6596a8be186691f155ff1218e9d5481390 [file] [log] [blame]
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This files defines a helper to trigger the registration of dialects to
// the system.
//
// Based on MLIR's InitAllDialects but for IREE dialects.
#ifndef IREE_TOOLS_INIT_DIALECTS_H_
#define IREE_TOOLS_INIT_DIALECTS_H_
#include "iree/tools/init_compiler_modules.h"
#include "iree/tools/init_iree_dialects.h"
#include "iree/tools/init_mlir_dialects.h"
#include "iree/tools/init_xla_dialects.h"
#ifdef IREE_HAVE_EMITC_DIALECT
#include "emitc/InitDialect.h"
#endif // IREE_HAVE_EMITC_DIALECT
namespace mlir {
namespace iree_compiler {
inline void registerAllDialects(DialectRegistry &registry) {
registerIreeDialects(registry);
registerMlirDialects(registry);
mlir::registerXLADialects(registry);
mlir::iree_compiler::registerIreeCompilerModuleDialects(registry);
#ifdef IREE_HAVE_EMITC_DIALECT
mlir::registerEmitCDialect(registry);
#endif // IREE_HAVE_EMITC_DIALECT
}
} // namespace iree_compiler
} // namespace mlir
#endif // IREE_TOOLS_INIT_DIALECTS_H_