[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


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

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

One particular comment I had in the area team meeting is that the number here will cause grief when reordering loops, inlining/outlining code, etc. One recommendation I gave was to follow the Perl idea of having labels in control flow constructs, and the terminators reference by name, rather than by number. It's also much easier to follow the code.

You only need name when you have far-reaching terminators, so current code continues as is.

example:
```mlir
scf.loop name=loopH {
  scf.loop { // no name needed
    scf.if %cond1 {
      ...
      scf.break loopH
    }
  }
}
```

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


More information about the Mlir-commits mailing list