[mlir] Add refineReturnTypes to InferTypeOpInterface
refineReturnType method shares the same parameters as inferReturnTypes but gets passed in the return types of the op if known that can be used during refinement passes or for more op specific error reporting. Currently the error reporting on failure is generic and doesn't allow for specializing the returned result based on failure, with this change what would previously have been a separate trait with specialized verification can just be handled as part of inferrence rather than duplicated. refineReturnTypes behaves like inferReturnTypes if no result types are fed in, while the current verification is recast as the default implementation for refineReturnTypes with it calling inferReturnTypes (and so the default type verification now goes through refine and allows for more op specific inference mismatch errors). Differential Revision: https://reviews.llvm.org/D129955
Loading
Please sign in to comment