Hello, I want to convert the following mlir file into a mlir file that only contains LLVM Dialect, but some errors occurred.
The initial documents are as follows:
builtin.module {
builtin.func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
cond_br %arg0, ^bb1, ^bb2
^bb1: // pred: ^bb0
%0 = memref.clone %arg1 : memref<2xf32> to memref<2xf32>
br ^bb3(%0 : memref<2xf32>)
^bb2: // pred: ^bb0
%1 = memref.alloc() : memref<2xf32>
test.buffer_based in(%arg1 : memref<2xf32>) out(%1 : memref<2xf32>)
%2 = memref.clone %1 : memref<2xf32> to memref<2xf32>
memref.dealloc %1 : memref<2xf32>
br ^bb3(%2 : memref<2xf32>)
^bb3(%3: memref<2xf32>): // 2 preds: ^bb1, ^bb2
test.copy(%3, %arg2) : (memref<2xf32>, memref<2xf32>)
memref.dealloc %3 : memref<2xf32>
return
}
}
When I use ./mlir-opt -convert-memref-to-llvm -convert-std-to-llvm test.mlir, the following error is thrown:
error: 'memref.clone' op operand #0 must be unranked.memref of any type values or memref of any type values, but got '!llvm.struct<(ptr<f32>, ptr<f32>, i64, array<1 x i64>, array<1 x i64>)>'
I want to know why this problem occurs and how can I solve it?
Thanks!