[mlir] Enable specifying verify on OpInterface
authorJacques Pienaar <jpienaar@google.com>
Tue, 21 Jan 2020 17:40:22 +0000 (09:40 -0800)
committerJacques Pienaar <jpienaar@google.com>
Wed, 22 Jan 2020 12:43:22 +0000 (04:43 -0800)
commit178562fb352d12b5235c63f75297b8a456b53a0f
tree9b2885d1ec0239ed5b3f59f9171ecd38f38b40bf
parent963f26818693afe8edd7826c9e4266a4cfc86dae
[mlir] Enable specifying verify on OpInterface

Summary:
Add method in ODS to specify verification for operations implementing a
OpInterface. Use this with infer type op interface to verify that the
inferred type matches the return type and remove special case in
TestPatterns.

This could also have been achieved by using OpInterfaceMethod but verify
seems pretty common and it is not an arbitrary method that just happened
to be named verifyTrait, so having it be defined in special way seems
appropriate/better documenting.

Differential Revision: https://reviews.llvm.org/D73122
mlir/docs/OpDefinitions.md
mlir/include/mlir/Analysis/InferTypeOpInterface.h
mlir/include/mlir/Analysis/InferTypeOpInterface.td
mlir/include/mlir/IR/OpBase.td
mlir/include/mlir/TableGen/OpInterfaces.h
mlir/lib/Analysis/InferTypeOpInterface.cpp
mlir/lib/TableGen/OpInterfaces.cpp
mlir/test/lib/TestDialect/TestPatterns.cpp
mlir/test/mlir-tblgen/return-types.mlir
mlir/tools/mlir-tblgen/OpInterfacesGen.cpp