From ee1d447e5fff7941f9c5cdb4abadc77830277efd Mon Sep 17 00:00:00 2001 From: River Riddle Date: Sat, 5 Mar 2022 12:27:00 -0800 Subject: [PATCH] [mlir][NFC] Move Translation.h to a Tools/mlir-translate directory Translation.h is currently awkwardly shoved into the top-level mlir, even though it is specific to the mlir-translate tool. This commit moves it to a new Tools/mlir-translate directory, which is intended for libraries used to implement tools. It also splits the translate registry from the main entry point, to more closely mirror what mlir-opt does. Differential Revision: https://reviews.llvm.org/D121026 --- .../standalone/standalone-translate/CMakeLists.txt | 2 +- .../standalone-translate/standalone-translate.cpp | 2 +- .../mlir/Tools/mlir-translate/MlirTranslateMain.h | 28 ++++++ .../mlir/{ => Tools/mlir-translate}/Translation.h | 15 +-- mlir/lib/CMakeLists.txt | 1 - mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt | 2 +- mlir/lib/Target/Cpp/CMakeLists.txt | 2 +- mlir/lib/Target/Cpp/TranslateRegistration.cpp | 2 +- mlir/lib/Target/LLVMIR/CMakeLists.txt | 4 +- mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp | 2 +- mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp | 2 +- mlir/lib/Target/SPIRV/CMakeLists.txt | 2 +- .../Target/SPIRV/Deserialization/CMakeLists.txt | 2 +- mlir/lib/Target/SPIRV/Serialization/CMakeLists.txt | 2 +- mlir/lib/Target/SPIRV/TranslateRegistration.cpp | 2 +- mlir/lib/Tools/CMakeLists.txt | 1 + mlir/lib/Tools/mlir-translate/CMakeLists.txt | 11 ++ .../lib/Tools/mlir-translate/MlirTranslateMain.cpp | 111 +++++++++++++++++++++ .../mlir-translate}/Translation.cpp | 91 +---------------- mlir/lib/Translation/CMakeLists.txt | 10 -- mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt | 2 +- mlir/tools/mlir-translate/CMakeLists.txt | 2 +- mlir/tools/mlir-translate/mlir-translate.cpp | 2 +- mlir/tools/mlir-vulkan-runner/CMakeLists.txt | 2 +- 24 files changed, 173 insertions(+), 129 deletions(-) create mode 100644 mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h rename mlir/include/mlir/{ => Tools/mlir-translate}/Translation.h (87%) create mode 100644 mlir/lib/Tools/mlir-translate/CMakeLists.txt create mode 100644 mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp rename mlir/lib/{Translation => Tools/mlir-translate}/Translation.cpp (61%) delete mode 100644 mlir/lib/Translation/CMakeLists.txt diff --git a/mlir/examples/standalone/standalone-translate/CMakeLists.txt b/mlir/examples/standalone/standalone-translate/CMakeLists.txt index 137f794..52464eb 100644 --- a/mlir/examples/standalone/standalone-translate/CMakeLists.txt +++ b/mlir/examples/standalone/standalone-translate/CMakeLists.txt @@ -17,7 +17,7 @@ target_link_libraries(standalone-translate MLIRParser MLIRPass MLIRSPIRV - MLIRTranslation + MLIRTranslateLib MLIRSupport ) diff --git a/mlir/examples/standalone/standalone-translate/standalone-translate.cpp b/mlir/examples/standalone/standalone-translate/standalone-translate.cpp index f2f0ac5..2c2f275 100644 --- a/mlir/examples/standalone/standalone-translate/standalone-translate.cpp +++ b/mlir/examples/standalone/standalone-translate/standalone-translate.cpp @@ -13,7 +13,7 @@ #include "mlir/InitAllTranslations.h" #include "mlir/Support/LogicalResult.h" -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/MlirTranslateMain.h" #include "Standalone/StandaloneDialect.h" diff --git a/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h b/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h new file mode 100644 index 0000000..4776987 --- /dev/null +++ b/mlir/include/mlir/Tools/mlir-translate/MlirTranslateMain.h @@ -0,0 +1,28 @@ +//===- MlirTranslateMain.h - MLIR Translation Driver main -------*- C++ -*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// +// +// Main entry function for mlir-translate for when built as standalone binary. +// +//===----------------------------------------------------------------------===// + +#ifndef MLIR_TOOLS_MLIRTRANSLATE_MLIRTRANSLATEMAIN_H +#define MLIR_TOOLS_MLIRTRANSLATE_MLIRTRANSLATEMAIN_H + +#include "mlir/Support/LogicalResult.h" +#include "llvm/ADT/StringRef.h" + +namespace mlir { +/// Translate to/from an MLIR module from/to an external representation (e.g. +/// LLVM IR, SPIRV binary, ...). This is the entry point for the implementation +/// of tools like `mlir-translate`. The translation to perform is parsed from +/// the command line. The `toolName` argument is used for the header displayed +/// by `--help`. +LogicalResult mlirTranslateMain(int argc, char **argv, StringRef toolName); +} // namespace mlir + +#endif // MLIR_TOOLS_MLIRTRANSLATE_MLIRTRANSLATEMAIN_H diff --git a/mlir/include/mlir/Translation.h b/mlir/include/mlir/Tools/mlir-translate/Translation.h similarity index 87% rename from mlir/include/mlir/Translation.h rename to mlir/include/mlir/Tools/mlir-translate/Translation.h index 202681c..d91e479 100644 --- a/mlir/include/mlir/Translation.h +++ b/mlir/include/mlir/Tools/mlir-translate/Translation.h @@ -9,8 +9,9 @@ // Registry for user-provided translations. // //===----------------------------------------------------------------------===// -#ifndef MLIR_TRANSLATION_H -#define MLIR_TRANSLATION_H + +#ifndef MLIR_TOOLS_MLIRTRANSLATE_TRANSLATION_H +#define MLIR_TOOLS_MLIRTRANSLATE_TRANSLATION_H #include "llvm/Support/CommandLine.h" @@ -96,14 +97,6 @@ struct TranslationParser : public llvm::cl::parser { size_t globalWidth) const override; }; -/// Translate to/from an MLIR module from/to an external representation (e.g. -/// LLVM IR, SPIRV binary, ...). This is the entry point for the implementation -/// of tools like `mlir-translate`. The translation to perform is parsed from -/// the command line. The `toolName` argument is used for the header displayed -/// by `--help`. -LogicalResult mlirTranslateMain(int argc, char **argv, - llvm::StringRef toolName); - } // namespace mlir -#endif // MLIR_TRANSLATION_H +#endif // MLIR_TOOLS_MLIRTRANSLATE_TRANSLATION_H diff --git a/mlir/lib/CMakeLists.txt b/mlir/lib/CMakeLists.txt index 05bfbb4..672a013 100644 --- a/mlir/lib/CMakeLists.txt +++ b/mlir/lib/CMakeLists.txt @@ -15,7 +15,6 @@ add_subdirectory(TableGen) add_subdirectory(Target) add_subdirectory(Tools) add_subdirectory(Transforms) -add_subdirectory(Translation) # Only enable the ExecutionEngine if the native target is configured in. if(TARGET ${LLVM_NATIVE_ARCH}) diff --git a/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt b/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt index 8ac1039..a5f0f7f 100644 --- a/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt +++ b/mlir/lib/Conversion/GPUToVulkan/CMakeLists.txt @@ -15,5 +15,5 @@ add_mlir_conversion_library(MLIRGPUToVulkanTransforms MLIRSPIRVSerialization MLIRSupport MLIRTransforms - MLIRTranslation + MLIRTranslateLib ) diff --git a/mlir/lib/Target/Cpp/CMakeLists.txt b/mlir/lib/Target/Cpp/CMakeLists.txt index 8263ef4..f1c4c42 100644 --- a/mlir/lib/Target/Cpp/CMakeLists.txt +++ b/mlir/lib/Target/Cpp/CMakeLists.txt @@ -14,5 +14,5 @@ add_mlir_translation_library(MLIRTargetCpp MLIRMath MLIRSCF MLIRSupport - MLIRTranslation + MLIRTranslateLib ) diff --git a/mlir/lib/Target/Cpp/TranslateRegistration.cpp b/mlir/lib/Target/Cpp/TranslateRegistration.cpp index 8257409..f5ee87d 100644 --- a/mlir/lib/Target/Cpp/TranslateRegistration.cpp +++ b/mlir/lib/Target/Cpp/TranslateRegistration.cpp @@ -15,7 +15,7 @@ #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/Dialect.h" #include "mlir/Target/Cpp/CppEmitter.h" -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/Translation.h" #include "llvm/Support/CommandLine.h" using namespace mlir; diff --git a/mlir/lib/Target/LLVMIR/CMakeLists.txt b/mlir/lib/Target/LLVMIR/CMakeLists.txt index 12ee38c..22daebc 100644 --- a/mlir/lib/Target/LLVMIR/CMakeLists.txt +++ b/mlir/lib/Target/LLVMIR/CMakeLists.txt @@ -30,7 +30,7 @@ add_mlir_translation_library(MLIRTargetLLVMIRExport MLIRDLTI MLIRLLVMIR MLIRLLVMIRTransforms - MLIRTranslation + MLIRTranslateLib ) add_mlir_translation_library(MLIRToLLVMIRTranslationRegistration @@ -62,5 +62,5 @@ add_mlir_translation_library(MLIRTargetLLVMIRImport LINK_LIBS PUBLIC MLIRDLTI MLIRLLVMIR - MLIRTranslation + MLIRTranslateLib ) diff --git a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp index c0cf8322..4db0ae3 100644 --- a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp +++ b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp @@ -20,7 +20,7 @@ #include "mlir/IR/MLIRContext.h" #include "mlir/Interfaces/DataLayoutInterfaces.h" #include "mlir/Target/LLVMIR/TypeFromLLVM.h" -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/Translation.h" #include "llvm/ADT/StringSet.h" #include "llvm/ADT/TypeSwitch.h" diff --git a/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp index 8f4bd7f..d64cfd0 100644 --- a/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp +++ b/mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp @@ -14,7 +14,7 @@ #include "mlir/IR/BuiltinOps.h" #include "mlir/Target/LLVMIR/Dialect/All.h" #include "mlir/Target/LLVMIR/Export.h" -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/Translation.h" #include "llvm/IR/LLVMContext.h" #include "llvm/IR/Module.h" diff --git a/mlir/lib/Target/SPIRV/CMakeLists.txt b/mlir/lib/Target/SPIRV/CMakeLists.txt index cddbc09..acfa68c 100644 --- a/mlir/lib/Target/SPIRV/CMakeLists.txt +++ b/mlir/lib/Target/SPIRV/CMakeLists.txt @@ -24,5 +24,5 @@ add_mlir_translation_library(MLIRSPIRVTranslateRegistration MLIRSPIRVSerialization MLIRSPIRVDeserialization MLIRSupport - MLIRTranslation + MLIRTranslateLib ) diff --git a/mlir/lib/Target/SPIRV/Deserialization/CMakeLists.txt b/mlir/lib/Target/SPIRV/Deserialization/CMakeLists.txt index 99d40e1..eec1472 100644 --- a/mlir/lib/Target/SPIRV/Deserialization/CMakeLists.txt +++ b/mlir/lib/Target/SPIRV/Deserialization/CMakeLists.txt @@ -11,7 +11,7 @@ add_mlir_translation_library(MLIRSPIRVDeserialization MLIRSPIRV MLIRSPIRVBinaryUtils MLIRSupport - MLIRTranslation + MLIRTranslateLib ) diff --git a/mlir/lib/Target/SPIRV/Serialization/CMakeLists.txt b/mlir/lib/Target/SPIRV/Serialization/CMakeLists.txt index a3eaaa0..5dc5cd2 100644 --- a/mlir/lib/Target/SPIRV/Serialization/CMakeLists.txt +++ b/mlir/lib/Target/SPIRV/Serialization/CMakeLists.txt @@ -11,7 +11,7 @@ add_mlir_translation_library(MLIRSPIRVSerialization MLIRSPIRV MLIRSPIRVBinaryUtils MLIRSupport - MLIRTranslation + MLIRTranslateLib ) diff --git a/mlir/lib/Target/SPIRV/TranslateRegistration.cpp b/mlir/lib/Target/SPIRV/TranslateRegistration.cpp index 2dad659..9522c79 100644 --- a/mlir/lib/Target/SPIRV/TranslateRegistration.cpp +++ b/mlir/lib/Target/SPIRV/TranslateRegistration.cpp @@ -21,7 +21,7 @@ #include "mlir/Support/FileUtilities.h" #include "mlir/Target/SPIRV/Deserialization.h" #include "mlir/Target/SPIRV/Serialization.h" -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/Translation.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/SMLoc.h" diff --git a/mlir/lib/Tools/CMakeLists.txt b/mlir/lib/Tools/CMakeLists.txt index 88c2b25..864e428 100644 --- a/mlir/lib/Tools/CMakeLists.txt +++ b/mlir/lib/Tools/CMakeLists.txt @@ -1,4 +1,5 @@ add_subdirectory(mlir-lsp-server) add_subdirectory(mlir-opt) add_subdirectory(mlir-reduce) +add_subdirectory(mlir-translate) add_subdirectory(PDLL) diff --git a/mlir/lib/Tools/mlir-translate/CMakeLists.txt b/mlir/lib/Tools/mlir-translate/CMakeLists.txt new file mode 100644 index 0000000..55aea58 --- /dev/null +++ b/mlir/lib/Tools/mlir-translate/CMakeLists.txt @@ -0,0 +1,11 @@ +add_mlir_library(MLIRTranslateLib + MlirTranslateMain.cpp + Translation.cpp + + ADDITIONAL_HEADER_DIRS + ${MLIR_MAIN_INCLUDE_DIR}/mlir/Tools/mlir-translate + + LINK_LIBS PUBLIC + MLIRIR + MLIRParser + ) diff --git a/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp b/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp new file mode 100644 index 0000000..bce04e7 --- /dev/null +++ b/mlir/lib/Tools/mlir-translate/MlirTranslateMain.cpp @@ -0,0 +1,111 @@ +//===- MlirTranslateMain.cpp - MLIR Translation entry point ---------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "mlir/Tools/mlir-translate/MlirTranslateMain.h" +#include "mlir/IR/AsmState.h" +#include "mlir/IR/BuiltinOps.h" +#include "mlir/IR/Dialect.h" +#include "mlir/IR/Verifier.h" +#include "mlir/Parser/Parser.h" +#include "mlir/Support/FileUtilities.h" +#include "mlir/Support/ToolUtilities.h" +#include "mlir/Tools/mlir-translate/Translation.h" +#include "llvm/Support/InitLLVM.h" +#include "llvm/Support/SourceMgr.h" +#include "llvm/Support/ToolOutputFile.h" + +using namespace mlir; + +//===----------------------------------------------------------------------===// +// Translation Parser +//===----------------------------------------------------------------------===// + +LogicalResult mlir::mlirTranslateMain(int argc, char **argv, + llvm::StringRef toolName) { + + static llvm::cl::opt inputFilename( + llvm::cl::Positional, llvm::cl::desc(""), + llvm::cl::init("-")); + + static llvm::cl::opt outputFilename( + "o", llvm::cl::desc("Output filename"), llvm::cl::value_desc("filename"), + llvm::cl::init("-")); + + static llvm::cl::opt allowUnregisteredDialects( + "allow-unregistered-dialect", + llvm::cl::desc("Allow operation with no registered dialects"), + llvm::cl::init(false)); + + static llvm::cl::opt splitInputFile( + "split-input-file", + llvm::cl::desc("Split the input file into pieces and " + "process each chunk independently"), + llvm::cl::init(false)); + + static llvm::cl::opt verifyDiagnostics( + "verify-diagnostics", + llvm::cl::desc("Check that emitted diagnostics match " + "expected-* lines on the corresponding line"), + llvm::cl::init(false)); + + llvm::InitLLVM y(argc, argv); + + // Add flags for all the registered translations. + llvm::cl::opt + translationRequested("", llvm::cl::desc("Translation to perform"), + llvm::cl::Required); + registerAsmPrinterCLOptions(); + registerMLIRContextCLOptions(); + llvm::cl::ParseCommandLineOptions(argc, argv, toolName); + + std::string errorMessage; + auto input = openInputFile(inputFilename, &errorMessage); + if (!input) { + llvm::errs() << errorMessage << "\n"; + return failure(); + } + + auto output = openOutputFile(outputFilename, &errorMessage); + if (!output) { + llvm::errs() << errorMessage << "\n"; + return failure(); + } + + // Processes the memory buffer with a new MLIRContext. + auto processBuffer = [&](std::unique_ptr ownedBuffer, + raw_ostream &os) { + MLIRContext context; + context.allowUnregisteredDialects(allowUnregisteredDialects); + context.printOpOnDiagnostic(!verifyDiagnostics); + llvm::SourceMgr sourceMgr; + sourceMgr.AddNewSourceBuffer(std::move(ownedBuffer), SMLoc()); + + if (!verifyDiagnostics) { + SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); + return (*translationRequested)(sourceMgr, os, &context); + } + + // In the diagnostic verification flow, we ignore whether the translation + // failed (in most cases, it is expected to fail). Instead, we check if the + // diagnostics were produced as expected. + SourceMgrDiagnosticVerifierHandler sourceMgrHandler(sourceMgr, &context); + (void)(*translationRequested)(sourceMgr, os, &context); + return sourceMgrHandler.verify(); + }; + + if (splitInputFile) { + if (failed(splitAndProcessBuffer(std::move(input), processBuffer, + output->os()))) + return failure(); + } else if (failed(processBuffer(std::move(input), output->os()))) { + return failure(); + } + + output->keep(); + return success(); +} diff --git a/mlir/lib/Translation/Translation.cpp b/mlir/lib/Tools/mlir-translate/Translation.cpp similarity index 61% rename from mlir/lib/Translation/Translation.cpp rename to mlir/lib/Tools/mlir-translate/Translation.cpp index 3d0a456..50b8547 100644 --- a/mlir/lib/Translation/Translation.cpp +++ b/mlir/lib/Tools/mlir-translate/Translation.cpp @@ -10,17 +10,13 @@ // //===----------------------------------------------------------------------===// -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/Translation.h" #include "mlir/IR/AsmState.h" #include "mlir/IR/BuiltinOps.h" #include "mlir/IR/Dialect.h" #include "mlir/IR/Verifier.h" #include "mlir/Parser/Parser.h" -#include "mlir/Support/FileUtilities.h" -#include "mlir/Support/ToolUtilities.h" -#include "llvm/Support/InitLLVM.h" #include "llvm/Support/SourceMgr.h" -#include "llvm/Support/ToolOutputFile.h" using namespace mlir; @@ -128,88 +124,3 @@ void TranslationParser::printOptionInfo(const llvm::cl::Option &o, }); llvm::cl::parser::printOptionInfo(o, globalWidth); } - -LogicalResult mlir::mlirTranslateMain(int argc, char **argv, - llvm::StringRef toolName) { - - static llvm::cl::opt inputFilename( - llvm::cl::Positional, llvm::cl::desc(""), - llvm::cl::init("-")); - - static llvm::cl::opt outputFilename( - "o", llvm::cl::desc("Output filename"), llvm::cl::value_desc("filename"), - llvm::cl::init("-")); - - static llvm::cl::opt allowUnregisteredDialects( - "allow-unregistered-dialect", - llvm::cl::desc("Allow operation with no registered dialects"), - llvm::cl::init(false)); - - static llvm::cl::opt splitInputFile( - "split-input-file", - llvm::cl::desc("Split the input file into pieces and " - "process each chunk independently"), - llvm::cl::init(false)); - - static llvm::cl::opt verifyDiagnostics( - "verify-diagnostics", - llvm::cl::desc("Check that emitted diagnostics match " - "expected-* lines on the corresponding line"), - llvm::cl::init(false)); - - llvm::InitLLVM y(argc, argv); - - // Add flags for all the registered translations. - llvm::cl::opt - translationRequested("", llvm::cl::desc("Translation to perform"), - llvm::cl::Required); - registerAsmPrinterCLOptions(); - registerMLIRContextCLOptions(); - llvm::cl::ParseCommandLineOptions(argc, argv, toolName); - - std::string errorMessage; - auto input = openInputFile(inputFilename, &errorMessage); - if (!input) { - llvm::errs() << errorMessage << "\n"; - return failure(); - } - - auto output = openOutputFile(outputFilename, &errorMessage); - if (!output) { - llvm::errs() << errorMessage << "\n"; - return failure(); - } - - // Processes the memory buffer with a new MLIRContext. - auto processBuffer = [&](std::unique_ptr ownedBuffer, - raw_ostream &os) { - MLIRContext context; - context.allowUnregisteredDialects(allowUnregisteredDialects); - context.printOpOnDiagnostic(!verifyDiagnostics); - llvm::SourceMgr sourceMgr; - sourceMgr.AddNewSourceBuffer(std::move(ownedBuffer), SMLoc()); - - if (!verifyDiagnostics) { - SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context); - return (*translationRequested)(sourceMgr, os, &context); - } - - // In the diagnostic verification flow, we ignore whether the translation - // failed (in most cases, it is expected to fail). Instead, we check if the - // diagnostics were produced as expected. - SourceMgrDiagnosticVerifierHandler sourceMgrHandler(sourceMgr, &context); - (void)(*translationRequested)(sourceMgr, os, &context); - return sourceMgrHandler.verify(); - }; - - if (splitInputFile) { - if (failed(splitAndProcessBuffer(std::move(input), processBuffer, - output->os()))) - return failure(); - } else if (failed(processBuffer(std::move(input), output->os()))) { - return failure(); - } - - output->keep(); - return success(); -} diff --git a/mlir/lib/Translation/CMakeLists.txt b/mlir/lib/Translation/CMakeLists.txt deleted file mode 100644 index 579de29..0000000 --- a/mlir/lib/Translation/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -add_mlir_library(MLIRTranslation - Translation.cpp - - ADDITIONAL_HEADER_DIRS - ${MLIR_MAIN_INCLUDE_DIR}/mlir/Translation - - LINK_LIBS PUBLIC - MLIRIR - MLIRParser - ) diff --git a/mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt b/mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt index 74bf6db..7029de6 100644 --- a/mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt +++ b/mlir/tools/mlir-spirv-cpu-runner/CMakeLists.txt @@ -29,7 +29,7 @@ if (MLIR_ENABLE_SPIRV_CPU_RUNNER) MLIRSPIRV MLIRTargetLLVMIRExport MLIRTransforms - MLIRTranslation + MLIRTranslateLib MLIRSupport ) endif() diff --git a/mlir/tools/mlir-translate/CMakeLists.txt b/mlir/tools/mlir-translate/CMakeLists.txt index 99b98f9..b1145f2 100644 --- a/mlir/tools/mlir-translate/CMakeLists.txt +++ b/mlir/tools/mlir-translate/CMakeLists.txt @@ -18,7 +18,7 @@ target_link_libraries(mlir-translate MLIRParser MLIRPass MLIRSPIRV - MLIRTranslation + MLIRTranslateLib MLIRSupport ) diff --git a/mlir/tools/mlir-translate/mlir-translate.cpp b/mlir/tools/mlir-translate/mlir-translate.cpp index 06ca10f..f39bf58 100644 --- a/mlir/tools/mlir-translate/mlir-translate.cpp +++ b/mlir/tools/mlir-translate/mlir-translate.cpp @@ -13,7 +13,7 @@ #include "mlir/InitAllTranslations.h" #include "mlir/Support/LogicalResult.h" -#include "mlir/Translation.h" +#include "mlir/Tools/mlir-translate/MlirTranslateMain.h" using namespace mlir; diff --git a/mlir/tools/mlir-vulkan-runner/CMakeLists.txt b/mlir/tools/mlir-vulkan-runner/CMakeLists.txt index 5e0ae14..7d331e7 100644 --- a/mlir/tools/mlir-vulkan-runner/CMakeLists.txt +++ b/mlir/tools/mlir-vulkan-runner/CMakeLists.txt @@ -73,7 +73,7 @@ if (MLIR_ENABLE_VULKAN_RUNNER) MLIRSupport MLIRTargetLLVMIRExport MLIRTransforms - MLIRTranslation + MLIRTranslateLib ${Vulkan_LIBRARY} ) -- 2.7.4