HomePhabricator

[MLIR] Fix genTypeInterfaceMethods() to work correctly with InferTypeOpInterface

Authored by jurahul on Dec 1 2020, 11:19 AM.

Description

[MLIR] Fix genTypeInterfaceMethods() to work correctly with InferTypeOpInterface

  • Change InferTypeOpInterface::inferResultTypes to use fully qualified types matching the ones generated by genTypeInterfaceMethods, so the redundancy can be detected.
  • Move genTypeInterfaceMethods() before genOpInterfaceMethods() so that the inferResultTypes method generated by genTypeInterfaceMethods() takes precedence over the declaration that might be generated by genOpInterfaceMethods()
  • Modified an op in the test dialect to exercise this (the modified op would fail to generate valid C++ code due to duplicate inferResultTypes methods).

Differential Revision: https://reviews.llvm.org/D92414