Issue 120392
Summary affine dialect → emitc dialect an error occurred
Labels
Assignees
Reporter pyl3000
    When I run `mlir-opt --lower-affine --convert-scf-to-emitc --convert-arith-to-emitc --convert-memref-to-emitc --convert-func-to-emitc matmul- affine.mlir -o matmul-emitc.mlir` with the following error:

![Image](https://github.com/user-attachments/assets/41928739-9bff-4cfd-92cb-8384784dfc2f)

matmul- affine.mlir as follow:

```
module {
  func.func @main() {
    %cst = arith.constant 0.000000e+00 : f64
    %cst_0 = arith.constant 6.000000e+00 : f64
    %cst_1 = arith.constant 5.000000e+00 : f64
    %cst_2 = arith.constant 4.000000e+00 : f64
    %cst_3 = arith.constant 3.000000e+00 : f64
    %cst_4 = arith.constant 2.000000e+00 : f64
    %cst_5 = arith.constant 1.000000e+00 : f64
    %alloc = memref.alloc() : memref<2x2xf64>
    %alloc_6 = memref.alloc() : memref<2x3xf64>
    affine.store %cst_5, %alloc_6[0, 0] : memref<2x3xf64>
    affine.store %cst_4, %alloc_6[0, 1] : memref<2x3xf64>
    affine.store %cst_3, %alloc_6[0, 2] : memref<2x3xf64>
    affine.store %cst_2, %alloc_6[1, 0] : memref<2x3xf64>
    affine.store %cst_1, %alloc_6[1, 1] : memref<2x3xf64>
    affine.store %cst_0, %alloc_6[1, 2] : memref<2x3xf64>
    affine.for %arg0 = 0 to 2 {
      affine.for %arg1 = 0 to 2 {
        affine.store %cst, %alloc[%arg1, %arg0] : memref<2x2xf64>
        affine.for %arg2 = 0 to 3 {
          %0 = affine.load %alloc_6[%arg0, %arg2] : memref<2x3xf64>
          %1 = affine.load %alloc_6[%arg1, %arg2] : memref<2x3xf64>
          %2 = affine.load %alloc[%arg1, %arg0] : memref<2x2xf64>
          %3 = arith.mulf %1, %0 : f64
          %4 = arith.addf %2, %3 : f64
          affine.store %4, %alloc[%arg1, %arg0] : memref<2x2xf64>
        }
      }
    }
    memref.dealloc %alloc_6 : memref<2x3xf64>
    memref.dealloc %alloc : memref<2x2xf64>
    return
  }
}
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to