Commit e40782f3 authored by Alex Zinenko's avatar Alex Zinenko Committed by Hans Wennborg
Browse files

[mlir][orc] unbreak MLIR ExecutionEngine after ORC changes

Changes to ORC in ce2207ab changed the
APIs in IRCompileLayer, now requiring the custom compiler to be wrapped
in IRCompileLayer::IRCompiler. Even though MLIR relies on Orc
CompileUtils, the type is still visible in several places in the code.
Adapt those to the new API.

(cherry picked from commit 7984b474)
parent b516ca06
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -256,14 +256,14 @@ Expected<std::unique_ptr<ExecutionEngine>> ExecutionEngine::create(
  // Callback to inspect the cache and recompile on demand. This follows Lang's
  // LLJITWithObjectCache example.
  auto compileFunctionCreator = [&](JITTargetMachineBuilder JTMB)
      -> Expected<IRCompileLayer::CompileFunction> {
      -> Expected<std::unique_ptr<IRCompileLayer::IRCompiler>> {
    if (jitCodeGenOptLevel)
      JTMB.setCodeGenOptLevel(jitCodeGenOptLevel.getValue());
    auto TM = JTMB.createTargetMachine();
    if (!TM)
      return TM.takeError();
    return IRCompileLayer::CompileFunction(
        TMOwningSimpleCompiler(std::move(*TM), engine->cache.get()));
    return std::make_unique<TMOwningSimpleCompiler>(std::move(*TM),
                                                    engine->cache.get());
  };

  // Create the LLJIT by calling the LLJITBuilder with 2 callbacks.