Hence the idea of making the input optional, in the absence of it, the logic could fall back on inspecting the operands.
Why we’d want (parent) op operands for scf.while? If we say “source region is ‘parent’”, the operands are that of the parent op, if we say “source region is region #N”, the operands are that of the terminator.
I’m pondering an idea of removing region terminators or at least making them dumb/non-extensible so that the entire logic of control flow is attached to the region-carrying operation itself rather than split between such an operation and its terminators. This seems to be a constant source of complexity, and most of the time we just define an equivalent of yield that is specific to a dialect (I know scf.condition and scf.forall.in_parallel are different, but these are the ones causing complexity… This is likely too aggressive and limiting, but we can rethink the interface to be more like this.