//===- ExecutionEngine.h - MLIR Execution engine and utils -----*- 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 // //===----------------------------------------------------------------------===// // // This file provides a JIT-backed execution engine for MLIR modules. // //===----------------------------------------------------------------------===// #ifndef MLIR_EXECUTIONENGINE_EXECUTIONENGINE_H_ #define MLIR_EXECUTIONENGINE_EXECUTIONENGINE_H_ #include "mlir/Support/LLVM.h" #include "llvm/ExecutionEngine/ObjectCache.h" #include "llvm/ExecutionEngine/Orc/LLJIT.h" #include "llvm/ExecutionEngine/SectionMemoryManager.h" #include "llvm/IR/LLVMContext.h" #include "llvm/Support/Error.h" #include <functional> #include <memory> #include <optional> namespace llvm { template <typename T> class Expected; class Module; class ExecutionEngine; class JITEventListener; class MemoryBuffer; } // namespace llvm namespace mlir { class Operation; /// A simple object cache following Lang's LLJITWithObjectCache example. class SimpleObjectCache : public llvm::ObjectCache { … }; struct ExecutionEngineOptions { … }; /// JIT-backed execution engine for MLIR. Assumes the IR can be converted to /// LLVM IR. For each function, creates a wrapper function with the fixed /// interface /// /// void _mlir_funcName(void **) /// /// where the only argument is interpreted as a list of pointers to the actual /// arguments of the function, followed by a pointer to the result. This allows /// the engine to provide the caller with a generic function pointer that can /// be used to invoke the JIT-compiled function. class ExecutionEngine { … }; } // namespace mlir #endif // MLIR_EXECUTIONENGINE_EXECUTIONENGINE_H_