Hi everyone,
Currently the func::CallOp
and func::ConstantOp
are limited to only refer to func::FuncOp
. However, there is a (quite extensive) FunctionOpInterface
(also implemented by FuncOp
) that, as far as I understood, should motivate and ease the implementation of domain-specific function operations. Would it be possible to lift these limitations and allow above mentioned operations to refer to all operations implementing the FunctionOpInterface
such that they can be reused or are there any reasons to explicitly forbid this? What would such a change entail (other than changing the two verification functions inside FuncOps.cpp
)?
I’m currently implementing such a more specific function operation that has a few additional verified attributes and is limited to 0 or 1 return values. Of course, I also need to be able to call that function, but I don’t need anything specific there, so I’d currently just have to copy-paste the rest of the func
dialect.
When we’re already at it, would it make sense to allow operations that implement the FunctionOpInterface
to also reuse the func.return
operation (i.e., generalizing the HasParent
constraint)?