[mlir] Simplify ModuleTranslation for LLVM IR
authorAlex Zinenko <zinenko@google.com>
Tue, 16 Feb 2021 16:36:45 +0000 (17:36 +0100)
committerAlex Zinenko <zinenko@google.com>
Tue, 16 Feb 2021 17:42:52 +0000 (18:42 +0100)
commitce8f10d6cbe03c1a78a7938070654d363e25f27d
treec56ea5ad42e3212f1341485414a96bdc492f0cf8
parentdf45c1813509fc579c5e0a4f2824923db92c2dbb
[mlir] Simplify ModuleTranslation for LLVM IR

A series of preceding patches changed the mechanism for translating MLIR to
LLVM IR to use dialect interface with delayed registration. It is no longer
necessary for specific dialects to derive from ModuleTranslation. Remove all
virtual methods from ModuleTranslation and factor out the entry point to be a
free function.

Also perform some cleanups in ModuleTranslation internals.

Depends On D96774

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D96775
15 files changed:
mlir/examples/toy/Ch6/toyc.cpp
mlir/examples/toy/Ch7/toyc.cpp
mlir/include/mlir/Target/LLVMIR.h
mlir/include/mlir/Target/LLVMIR/Export.h [new file with mode: 0644]
mlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
mlir/lib/ExecutionEngine/ExecutionEngine.cpp
mlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp
mlir/lib/Target/LLVMIR/Dialect/LLVMIR/LLVMToLLVMIRTranslation.cpp
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp
mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
mlir/tools/mlir-rocm-runner/mlir-rocm-runner.cpp
mlir/tools/mlir-spirv-cpu-runner/mlir-spirv-cpu-runner.cpp