[TableGen] Fix builder for ops with one variadic input and SameValueType
authorLei Zhang <antiagainst@google.com>
Tue, 16 Apr 2019 20:20:38 +0000 (13:20 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Thu, 18 Apr 2019 18:48:42 +0000 (11:48 -0700)
commitb8dc04a00504fbefe020821757769c68cbcd49a2
tree520b052caf6ef045f67835088dbe2644a1945094
parent5d783ab3bd88482b6d266748d1322cd7500d9a77
[TableGen] Fix builder for ops with one variadic input and SameValueType

    For ops with the SameValueType trait, we generate a builder without requiring
    result type; we get the result type from the operand. However, if the operand
    is variadic, we need to index into the first value in the pack.

--

PiperOrigin-RevId: 243866647
mlir/test/mlir-tblgen/op-builder.td [new file with mode: 0644]
mlir/tools/mlir-tblgen/OpDefinitionsGen.cpp