1 | //===- mlir-cpu-runner.cpp - MLIR CPU Execution Driver---------------------===// |
---|---|
2 | // |
3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
4 | // See https://llvm.org/LICENSE.txt for license information. |
5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
6 | // |
7 | //===----------------------------------------------------------------------===// |
8 | // |
9 | // Main entry point to a command line utility that executes an MLIR file on the |
10 | // CPU by translating MLIR to LLVM IR before JIT-compiling and executing the |
11 | // latter. |
12 | // |
13 | //===----------------------------------------------------------------------===// |
14 | |
15 | #include "mlir/Dialect/LLVMIR/LLVMDialect.h" |
16 | #include "mlir/ExecutionEngine/JitRunner.h" |
17 | #include "mlir/ExecutionEngine/OptUtils.h" |
18 | #include "mlir/IR/Dialect.h" |
19 | #include "mlir/Target/LLVMIR/Dialect/All.h" |
20 | |
21 | #include "llvm/Support/InitLLVM.h" |
22 | #include "llvm/Support/TargetSelect.h" |
23 | |
24 | int main(int argc, char **argv) { |
25 | llvm::InitLLVM y(argc, argv); |
26 | llvm::InitializeNativeTarget(); |
27 | llvm::InitializeNativeTargetAsmPrinter(); |
28 | llvm::InitializeNativeTargetAsmParser(); |
29 | |
30 | mlir::DialectRegistry registry; |
31 | mlir::registerAllToLLVMIRTranslations(registry); |
32 | |
33 | return mlir::JitRunnerMain(argc, argv, registry); |
34 | } |
35 |