Can an OpInterface implement/extend another OpInterface?

Is there a way to let an OpInterface implement/extend another OpInterface?

Let me give an example. The LinalgOp interface implements joint functionality for a multitude of operations such as linalg.matmul, linalg.fill, linalg.copy etc. We now have a TilingInterface to abstract tiling specific functionality. Is it possible to implement the TilingInterface for all LinalgOps by extending the LinalgOp interface or do we need to implement the TilingInterface separately for each individual operation.

I’ve wanted something like this before as well :+1:

I don’t think so, but in general we get away with this with various TableGen-fu to avoid duplicating code.

One example of this today is how the ReifyRankedShapedTypeOpInterface is implemented for all LinalgOps. The method reifyResultShapes is expected to be implemented by all operations that implement the ReifyRankedShapedTypeOpInterface. This method is implemented by the LinalgOp interface as well, and I just have a re-direction in the op definition (here) that forwards the query through the ReifyRankedShapedTypeOpInterface to the implementation in the LinalgOp interface

Thanks for your responses. I think code generation and forwarding to the LinalgOp interface should help in our use case.