diff options
| author | Alex Zinenko <zinenko@google.com> | 2019-02-08 08:59:23 -0800 |
|---|---|---|
| committer | jpienaar <jpienaar@google.com> | 2019-03-29 16:22:08 -0700 |
| commit | f5b99275d23092be1448d768c3558b733aa97389 (patch) | |
| tree | 28a90882e352f3d535b6b06831ba5dae6bde7643 /mlir/lib/ExecutionEngine | |
| parent | 4c35bbbb518ecb7b78c58b55759d10109f92b59e (diff) | |
| download | bcm5719-llvm-f5b99275d23092be1448d768c3558b733aa97389.tar.gz bcm5719-llvm-f5b99275d23092be1448d768c3558b733aa97389.zip | |
Cleanups in ExecutionEngine.
Make sure the module is always passed to the optimization layer.
Drop unused default argument for the IR transformation and remove the function
that was only used in this default argument. The transformation wrapper
constructor already checks for the null function, so the caller can just pass
`{}` if they don't want any transformation (no callers currently need this).
PiperOrigin-RevId: 233068817
Diffstat (limited to 'mlir/lib/ExecutionEngine')
| -rw-r--r-- | mlir/lib/ExecutionEngine/ExecutionEngine.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp index d3081f67459..0662c42420a 100644 --- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp @@ -101,7 +101,7 @@ public: // Create a JIT engine for the current host. static Expected<std::unique_ptr<OrcJIT>> - createDefault(IRTransformer transformer = identity) { + createDefault(IRTransformer transformer) { auto machineBuilder = llvm::orc::JITTargetMachineBuilder::detectHost(); if (!machineBuilder) return machineBuilder.takeError(); @@ -116,7 +116,7 @@ public: // Add an LLVM module to the main library managed by the JIT engine. Error addModule(std::unique_ptr<llvm::Module> M) { - return compileLayer.add( + return transformLayer.add( session.getMainJITDylib(), llvm::orc::ThreadSafeModule(std::move(M), threadSafeCtx)); } @@ -127,9 +127,6 @@ public: } private: - // Do not transform the module. - static Error identity(llvm::Module *m) { return Error::success(); } - // Wrap the `irTransformer` into a function that can be called by the // IRTranformLayer. If `irTransformer` is not set up, return the module as is // without errors. |

