Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Conversion/TosaToSCF/tosa-to-scf.mlir
Show All 24 Lines | ^bb0(%arg2: tensor<i32>): | ||||
%3 = "tosa.add"(%arg2, %2) : (tensor<i32>, tensor<i32>) -> tensor<i32> | %3 = "tosa.add"(%arg2, %2) : (tensor<i32>, tensor<i32>) -> tensor<i32> | ||||
// CHECK: scf.yield [[ADD]] | // CHECK: scf.yield [[ADD]] | ||||
"tosa.yield"(%3) : (tensor<i32>) -> () | "tosa.yield"(%3) : (tensor<i32>) -> () | ||||
}) : (tensor<i32>) -> (tensor<i32>) | }) : (tensor<i32>) -> (tensor<i32>) | ||||
return %1 : tensor<i32> | return %1 : tensor<i32> | ||||
} | } | ||||
// ---- | // ----- | ||||
// CHECK-LABEL: func @if_test | // CHECK-LABEL: func @if_test | ||||
// CHECK-SAME: ([[ARG0:%.+]]: tensor<f32>, [[ARG1:%.+]]: tensor<f32>, [[ARG2:%.+]]: tensor<i1>) | // CHECK-SAME: ([[ARG0:%.+]]: tensor<f32>, [[ARG1:%.+]]: tensor<f32>, [[ARG2:%.+]]: tensor<i1>) | ||||
func @if_test(%arg0 : tensor<f32>, %arg1 : tensor<f32>, %arg2 : tensor<i1>) -> (tensor<f32>) { | func @if_test(%arg0 : tensor<f32>, %arg1 : tensor<f32>, %arg2 : tensor<i1>) -> (tensor<f32>) { | ||||
// CHECK: [[EX:%.+]] = tensor.extract [[ARG2]] | // CHECK: [[EX:%.+]] = tensor.extract [[ARG2]] | ||||
// CHECK: [[IF:%.+]] = scf.if [[EX]] -> (tensor<f32>) { | // CHECK: [[IF:%.+]] = scf.if [[EX]] -> (tensor<f32>) { | ||||
%0 = "tosa.cond_if"(%arg2, %arg0, %arg1) ({ | %0 = "tosa.cond_if"(%arg2, %arg0, %arg1) ({ | ||||
Show All 17 Lines |