[mlir] Generalize intrinsic builders in the LLVM dialect definition
authorAlex Zinenko <zinenko@google.com>
Fri, 21 Feb 2020 13:45:51 +0000 (14:45 +0100)
committerAlex Zinenko <zinenko@google.com>
Tue, 25 Feb 2020 10:59:04 +0000 (11:59 +0100)
commit00d4814f499fd09f8cf326c1c1a219175268b970
tree5931878b6156ac8c88d4782e7771d8e44bc96eb4
parentdecd021facba804b57e8d80b6159c987d3261ab8
[mlir] Generalize intrinsic builders in the LLVM dialect definition

All LLVM IR intrinsics are constructed in a similar way. The ODS definition of
the LLVM dialect in MLIR also lists multiple intrinsics, many of which
reproduce the same (or similar enough) code stanza to translate the MLIR
operation into the LLVM IR intrinsic. Provide a single base class containing
parameterizable code to build LLVM IR intrinsics given their name and the lists
of overloadable operands and results. Use this class to remove (almost)
duplicate translations for intrinsics defined in LLVMOps.td.

Differential Revision: https://reviews.llvm.org/D74889
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td