[Mlir-commits] [mlir] [MLIR] Introduce support for early exits (PR #166688)
Renato Golin
llvmlistbot at llvm.org
Sat Mar 28 16:12:37 PDT 2026
https://github.com/rengolin commented:
My main concern that I discussed on the area team office hours was that break/continue can leave dangling references/allocations or partial applications. While users of such operations should bear the cost of making those decisions, we still need to provide enough tools for them to do so.
Going back on the [`invoke`](https://llvm.org/docs/LangRef.html#invoke-instruction) discussions many years ago, we needed a way to allow users to inject the necessary cleanups (like conditional deallocations) when breaking control flow beyond the local scope.
This case looks much simpler than exception handling, so it's possible that none is needed, but it would be good to understand the kinds of cases we're trying to cover and make it explicit (at least in the documentation) that this is the case.
Otherwise, the PR looks similar to the proposal in the early [RFC](https://discourse.llvm.org/t/rfc-region-based-control-flow-with-early-exits-in-mlir/76998) from @Mogball.
https://github.com/llvm/llvm-project/pull/166688
More information about the Mlir-commits
mailing list