[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Simplify handling of dropped arguments (PR #96207)

Matthias Springer llvmlistbot at llvm.org
Sun Jun 30 08:23:57 PDT 2024


matthias-springer wrote:

I debugged this a bit. There's a bug in the dialect conversion driver. It was already broken before this PR, but in a different way.

In this example, the operand of the `"test.foo"` is just changed to `!llvm.struct`, which happens to work if it were a `builtin.unrealized_conversion_cast` (as in your example), but is generally wrong.

```
  func.func @reproducer() -> !llvm.struct<(f64, f64)> {
    %cst = complex.constant [0.000000e+00, 0.000000e+00] : complex<f64>
    %true = arith.constant true
    %0 = scf.if %true -> complex<f64> {
      scf.yield %cst : complex<f64>
    } else {
      scf.yield %cst : complex<f64>
    }
    %1 = "test.foo"(%0) : (complex<f64>) -> (!llvm.struct<(f64, f64)>)
    return %1 : !llvm.struct<(f64, f64)>
  }
```


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


More information about the Mlir-commits mailing list