@brief Lower the Quake code to the LLVM Dialect, call `PassManager`.
| 979 | |
| 980 | /// @brief Lower the Quake code to the LLVM Dialect, call `PassManager`. |
| 981 | void jitCode(std::vector<std::string> extraLibPaths = {}) override { |
| 982 | auto [wasChanged, ptr] = |
| 983 | detail::jitCode(*opBuilder, jitEngine.get(), jitEngineToModuleHash, |
| 984 | kernelName, extraLibPaths, stateVectorStorage); |
| 985 | // If we had a jitEngine, but the code changed, delete the one we had. |
| 986 | if (jitEngine && wasChanged) |
| 987 | detail::deleteJitEngine(jitEngine.release()); |
| 988 | |
| 989 | // Store for the next time if we haven't already |
| 990 | if (!jitEngine) |
| 991 | jitEngine = std::unique_ptr<mlir::ExecutionEngine, |
| 992 | void (*)(mlir::ExecutionEngine *)>( |
| 993 | ptr, detail::deleteJitEngine); |
| 994 | } |
| 995 | |
| 996 | /// @brief Invoke JIT compilation and extract a function pointer and execute. |
| 997 | void jitAndInvoke(void **argsArray, |
no test coverage detected