[mlir] Use TypedValue in single result traits
authorRahul Kayaith <rkayaith@gmail.com>
Thu, 26 Jan 2023 18:43:56 +0000 (13:43 -0500)
committerRahul Kayaith <rkayaith@gmail.com>
Thu, 2 Feb 2023 02:54:53 +0000 (21:54 -0500)
commita0b21046d8a3891b36fc992d97bc9daf4b3ce385
tree5a857be21b8d5edd374b3367df074ead4dfa0505
parentdf9500c295313f5830fa2f68735cf125a7be4ca3
[mlir] Use TypedValue in single result traits

Ops with a single result currently get a `getResult()` method +
conversion operator to `Value` through the `OneResult` trait. By moving
these to the `OneTypedResult` trait instead, we can use `TypedValue` as
the return type to get more specfic types.

When the result type is unknown ODS adds the
`OneTypedResult<mlir::Type>` trait, in which case there is no change in
the resulting API.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D142852
mlir/include/mlir/IR/OpDefinition.h
mlir/test/lib/Dialect/Test/TestPatterns.cpp