- allow return op to be used from the top level of any op with a region (as opposed to just from the top level of a func op)
- the return operand count/types should match the op results' (whenever it's not in a FuncOp's region).
This allows std.return to be used both in a declarative (FuncOp) as well as an imperative (typical op) setting --- avoiding the need to create custom return ops wherever control is to be transferred to the enclosing operation (in line with the control flow semantics of regions) and values are to be potentially returned. This also enables the proposed execute_region and affine.graybox ops to hold a list of blocks (with return terminators and values being returned).
There is no change in the terminator restrictions on affine.for/affine.if or any other registered ops with regions. affine.for/if continue to need "affine.terminator" at the end of their blocks.
Can you also update the ODS description?