I am not able to convert linalg-on-tensor dialect to llvm dialect
The mlir file which I want to convert is :
#map = affine_map<(d0, d1) -> (0, d1)>
#map1 = affine_map<(d0, d1) -> (d0, d1)>
module attributes {torch.debug_module_name = "AnnModel"} {
ml_program.global private mutable @global_seed(dense<0> : tensor<i64>) : tensor<i64>
func.func @forward(%arg0: tensor<1x2xf32>) -> tensor<1x2xf32> {
%0 = tensor.empty() : tensor<1x2xf32>
%1 = linalg.generic {indexing_maps = [#map, #map, #map1], iterator_types = ["parallel", "parallel"]} ins(%arg0, %arg0 : tensor<1x2xf32>, tensor<1x2xf32>) outs(%0 : tensor<1x2xf32>) {
^bb0(%in: f32, %in_0: f32, %out: f32):
%2 = arith.addf %in, %in_0 : f32
linalg.yield %2 : f32
} -> tensor<1x2xf32>
return %1 : tensor<1x2xf32>
}
}
using the command
mlir-opt ann_linalg_on_tensors.mlir --convert-linalg-to-llvm
and getting an error:
ann_linalg_on_tensors.mlir:7:10: error: 'linalg.generic' op expects regions to end with 'linalg.yield', found 'llvm.return'
%1 = linalg.generic {indexing_maps = [#map, #map, #map1], iterator_types = ["parallel", "parallel"]} ins(%arg0, %arg0 : tensor<1x2xf32>, tensor<1x2xf32>) outs(%0 : tensor<1x2xf32>) {
^
ann_linalg_on_tensors.mlir:7:10: note: see current operation:
%1 = "linalg.generic"(%arg0, %arg0, %0) ({
^bb0(%arg1: f32, %arg2: f32, %arg3: f32):
%2 = "arith.addf"(%arg1, %arg2) {fastmath = #arith.fastmath<none>} : (f32, f32) -> f32
"llvm.return"(%2) : (f32) -> ()
}) {indexing_maps = [affine_map<(d0, d1) -> (0, d1)>, affine_map<(d0, d1) -> (0, d1)>, affine_map<(d0, d1) -> (d0, d1)>], iterator_types = [#linalg.iterator_type<parallel>, #linalg.iterator_type<parallel>], operand_segment_sizes = array<i32: 2, 1>} : (tensor<1x2xf32>, tensor<1x2xf32>, tensor<1x2xf32>) -> tensor<1x2xf32>
ann_linalg_on_tensors.mlir:7:10: note: in custom textual format, the absence of terminator implies 'linalg.yield'
Please help me out