[mlir][llvm] Use TableGen to import compare ops from LLVM IR.
authorTobias Gysi <tobias.gysi@nextsilicon.com>
Thu, 13 Oct 2022 11:45:13 +0000 (14:45 +0300)
committerTobias Gysi <tobias.gysi@nextsilicon.com>
Thu, 13 Oct 2022 12:31:04 +0000 (15:31 +0300)
commitcc49a74a7bc6790d3502d1c2666712c1ef0c211b
tree8b872e76b564b2d7b4ab93dd8728bd5fee18ba11
parent0623ce152a02eed954a1de82a1430d6d00647c9f
[mlir][llvm] Use TableGen to import compare ops from LLVM IR.

The revision imports compare operations using TableGen generated
builders, instead of using the special handlers defined by the Importer.
It therefore adds a new llvmArgIndexes field that allows to specify
a mapping between MLIR argument and LLVM IR operand indexes if they do
not match. Additionally, the FCmp op is extended with an additional
builder and all compare operations are extended with verification
traits to ensure the operands types match. These extensions simplify
the logic of the newly introduced builders and are in line with the
compare operations define by the arithmetic dialect.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D135855
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/test/Target/LLVMIR/Import/basic.ll
mlir/test/Target/LLVMIR/Import/instructions.ll
mlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp