[Mlir-commits] [mlir] [MLIR][ControlFlowToSCF] Extend with support for FuncOpInterface (PR #118937)

Markus Böck llvmlistbot at llvm.org
Fri Dec 6 01:20:04 PST 2024


https://github.com/zero9178 commented:

Making this work using the function interface makes sense!

The only problem I see is further up at line 147. It very much assumes it is nested in a `func::FuncOp`. We'd need either some other logic to create the right kind of return like operation, or the `ub.unreachable` mentioned in the TODO. 

Otherwise code such as:
```mlir

llvm.func @foo() {
  cf.br

^bb0:
  llvm.call @sideeffect()
  cf.br ^bb0
}
```
will cause an error

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


More information about the Mlir-commits mailing list