[mlir] Generator converting LLVM intrinsics defs to MLIR ODS
authorAlex Zinenko <zinenko@google.com>
Fri, 17 Jan 2020 17:16:07 +0000 (18:16 +0100)
committerAlex Zinenko <zinenko@google.com>
Fri, 17 Jan 2020 17:20:24 +0000 (18:20 +0100)
commitf343544b813891387add8ef01406d36b82ed0a7e
tree4ca3735ed321e00b07705b2138f9fdd1d7940514
parentb9d2bf38e86e6dd8a2f188d9a24f546aa67de8af
[mlir] Generator converting LLVM intrinsics defs to MLIR ODS

Introduce a new generator for MLIR tablegen driver that consumes LLVM IR
intrinsic definitions and produces MLIR ODS definitions. This is useful to
bulk-generate MLIR operations equivalent to existing LLVM IR intrinsics, such
as additional arithmetic instructions or NVVM.

A test exercising the generation is also added. It reads the main LLVM
intrinsics file and produces ODS to make sure the TableGen model remains in
sync with what is used in LLVM.

Differential Revision: https://reviews.llvm.org/D72926
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/test/mlir-tblgen/llvm-intrinsics.td [new file with mode: 0644]
mlir/tools/mlir-tblgen/CMakeLists.txt
mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp [new file with mode: 0644]