The ForOp::build ensures that there is a block terminator which is great for the default use case when there are no iter_args and loop.for returns no results. In non-zero results case we always need to call replaceOpWithNewOp which is not the nicest thing in the world. We can stop inserting YieldOp when iter_args is non-empty. IfOp::build already behaves similarly.
23 KiB
23 KiB