[Mlir-commits] [mlir] [mlir][affine]fix create affine.for bug. (PR #117721)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Nov 27 04:51:34 PST 2024


https://github.com/ftynse requested changes to this pull request.

Thank you. Let's first understand whether this is a bug or the intended behavior. This starts with adding a test. The test should show that something that wasn't accepted as a symbol becomes accepted as a symbol, i.e. does not emit an error, after the patch.

Also consider the fact not all block arguments are function arguments. One can perfectly well have a

```
func.func @foo(...) {
  cf.br ^bb1(...)

^bb1(%bbarg: memref<?xf32>):
  %dim = memref.dim %bbarg, %c0
  %new = call @memref_realloc(%bbarg, 2 * %dim)
  cf.cond_br ^bb1(%new), ^bb2

^bb2:
  return
}
```

where `%bbarg` is a block argument, but it's `dim` cannot be used as a symbol because it changes.

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


More information about the Mlir-commits mailing list