This limitation seems weird. Is it because nobody uses this operation (and so nobody really takes the time to develop it) or is there some deeper technical reason?
Dumitru
It is only used for dynamic_tensor_from_elements, and returning one value is all that is allowed there. In principle, we could rename it std.dynamic_tensor_from_elements_yield
to be consistent with std.atomic_yield
(used by std.generic_atomic_rmw’s region) which would avoid this confusion. Or we can change both to use std.yield
and make that op more generic.
@herhut who I think added std.yield.
It is indeed weird - I guess the use case for multiple operands didn’t exist. But we actually do need that generality - the std.execute_region op
(⚙ D75837 [MLIR] Introduce scf.execute_region op) which is otherwise ready to land was waiting for std.yield
, and it can be an arbitrary number of values yielded there.
I’m programming a toy FFT (for demo purposes). The FFT is a rather common example in signal processing. When you program it, the butterfly stages are maps with two input and two output vectors. But right now I have to use two instances of dynamic_tensor_from_elements
(twice the loop code). You probably have other implementations of this example, but if not I can provide it.