[Mlir-commits] [mlir] [MLIR] Introduce support for early exits (PR #166688)

Renato Golin llvmlistbot at llvm.org
Tue Mar 31 06:50:41 PDT 2026


================

----------------
rengolin wrote:

> I see scf.for as a simple loop with guarantee that its trip count is directly inferable from the operands, it makes it a nice property for some analysis. Adding break capabilities would make this moot, I don't think it's desirable?

I don't think so. This seems to be the agreement on the RFC.

> scf.while does not have this property, and I think scf.loop would make scf.while not useful anymore.

This is the key point: Why not discuss the merits of `scf.while` and how to address the same use with breaking control flow? Right now it seems you're adding a new op to do basically the same thing but in a different way.

> I was wondering if you're asking something else here with "escaping regions that weren't counting on that behaviour", and if so to clarify the difference. If not then I hope the [pointers I provided to the verifier](https://github.com/llvm/llvm-project/pull/166688#discussion_r3015141863) in the other thread are answering, let me know.

Yes, it's the same. :) You answered both at the same time and I missed it.

https://github.com/llvm/llvm-project/pull/166688


More information about the Mlir-commits mailing list