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

Henrich Lauko llvmlistbot at llvm.org
Sat Apr 4 05:32:46 PDT 2026


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

----------------
xlauko wrote:

I agree here, this will also align with newly added labeled loops in  C and proposed for C++, so we can directly use it later in CIR.

I guess we could use symbol infrastructure for this too, e.g.:

```
%result = scf.loop @outer -> f32 {
  scf.loop @inner -> f32 {
    scf.if %found {
      scf.break @outer %value : f32
    }
    scf.continue @outer
  }
}
```

the benefit this adds is that you can more easily verify/preserve intent in case of nesting modifications, not silently breaking it.

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


More information about the Mlir-commits mailing list