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/ExecutionEngine/JitRunner.h"
16 #include "mlir/ExecutionEngine/OptUtils.h"
17 #include "mlir/InitAllDialects.h"
18 #include "llvm/Support/InitLLVM.h"
19 #include "llvm/Support/TargetSelect.h"
20 
main(int argc,char ** argv)21 int main(int argc, char **argv) {
22   llvm::InitLLVM y(argc, argv);
23   llvm::InitializeNativeTarget();
24   llvm::InitializeNativeTargetAsmPrinter();
25   llvm::InitializeNativeTargetAsmParser();
26   mlir::initializeLLVMPasses();
27 
28   return mlir::JitRunnerMain(argc, argv);
29 }
30