[mlir][TableGen] Support intrinsics with multiple returns and overloaded operands.
authorJi Kim <jikimjikim@google.com>
Thu, 19 Nov 2020 08:54:31 +0000 (09:54 +0100)
committerAlex Zinenko <zinenko@google.com>
Thu, 19 Nov 2020 08:59:42 +0000 (09:59 +0100)
commit58ce4a8b1190f2ccc584140ca7fd1a6391846f3d
treef88dad596dd4593fa3718032941b1c8569e5d9a9
parentffe6c97f6b6e996f22ec3ca4a886dbb0d4f6f6fa
[mlir][TableGen] Support intrinsics with multiple returns and overloaded operands.

For intrinsics with multiple returns where one or more operands are overloaded, the overloaded type is inferred from the corresponding field of the resulting struct, instead of accessing the result directly.

As such, the hasResult parameter of LLVM_IntrOpBase (and derived classes) is replaced with numResults. TableGen for intrinsics also updated to populate this field with the total number of results.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D91680
mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
mlir/test/Target/llvmir-intrinsics.mlir
mlir/tools/mlir-tblgen/LLVMIRIntrinsicGen.cpp