[mlir][llvm] Tablegen based operation import from LLVM IR.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 12 Oct 2022 11:23:10 +0000 (14:23 +0300)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Wed, 12 Oct 2022 11:36:41 +0000 (14:36 +0300)
commit8446f24ef03928f511ab59dae17a8aa581b0ab62
tree6dacc75b1cb3f7471f24d11857d8c72a2868f1a2
parentfbad5fdc03d90988999b54eb630a9d509098d58d
[mlir][llvm] Tablegen based operation import from LLVM IR.

The revision uses tablegen generated builders to convert the most common
LLVM IR instructions to MLIR LLVM dialect operations. All instructions
with special handlers, except for alloca and fence, still use manual
handlers. The revision also introduces an additional "instructions.ll"
test file to test the import of instructions that have tablegen builders
(except for the resume instruction whose test remains untouched). A part
of the test cases are new, for example the integer instruction test,
while others are migrated from the "basic.ll" test file.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135709
mlir/include/mlir/Dialect/LLVMIR/CMakeLists.txt
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/test/Target/LLVMIR/Import/basic.ll
mlir/test/Target/LLVMIR/Import/instructions.ll [new file with mode: 0644]
mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp