I’m converting a tensorflow model to MLIR, but I’m having a problem, I can’t lower linalg.map,this caused me to not be able to convert to llvm ir…I looked at some of lower’s test cases, but I have a question. Why can’t some of the passes be used in, for example -test-tiling-interface=lower-to-scalar-using-scf-for
.I have a question, what does the pass at the beginning of test
mean?Here is some of the code.If anyone can help me, I would be grateful.
// Here are some of the passes I use
mlir-opt resnet.mlir -pass-pipeline="builtin.module(func.func(tosa-to-linalg-
named), \
func.func(tosa-to-tensor),func.func(tosa-to-linalg),func.func(tosa-to-arith))" | \
mlir-opt -linalg-bufferize -empty-tensor-to-alloc-tensor -arith-bufferize \
-tensor-bufferize -func-bufferize -buffer-deallocation -convert-linalg-to-loops \
-convert-vector-to-scf -convert-scf-to-cf \
-convert-vector-to-llvm -arith-expand -convert-math-to-llvm \
-expand-strided-metadata -finalize-memref-to-llvm -convert-math-to-llvm \
-convert-func-to-llvm -llvm-request-c-wrappers -reconcile-unrealized-casts
Here is part of the code of the model, I found how I could not lower the linag.map.
%6076 = bufferization.to_tensor %6075 : memref<1x305x305x3xf32>
%6077 = llvm.extractvalue %6074[0] : !llvm.struct<(ptr, ptr, i64, array<4 x i64>, array<4 x i64>)>
llvm.call @free(%6077) : (!llvm.ptr) -> ()
%mapped = linalg.map outs(%6076 : tensor<1x305x305x3xf32>)
() {
linalg.yield %28 : f32
}