Please use GitHub pull requests for new patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Conversion/TosaToTensor/tosa-to-tensor.mlir
Show First 20 Lines • Show All 244 Lines • ▼ Show 20 Lines | func.func @concat_non_axis_dyn(%arg0: tensor<5x?xf32>, %arg1: tensor<6x?xf32>) -> () { | ||||
return | return | ||||
} | } | ||||
// ----- | // ----- | ||||
// CHECK-LABEL: @concat_axis_dyn | // CHECK-LABEL: @concat_axis_dyn | ||||
// CHECK-SAME: (%[[ARG0:[0-9a-zA-Z_]*]]: | // CHECK-SAME: (%[[ARG0:[0-9a-zA-Z_]*]]: | ||||
// CHECK-SAME: %[[ARG1:[0-9a-zA-Z_]*]]: | // CHECK-SAME: %[[ARG1:[0-9a-zA-Z_]*]]: | ||||
func.func @concat_axis_dyn(%arg0: tensor<?x3xf32>, %arg1: tensor<?x3xf32>) -> () { | func.func @concat_axis_dyn(%arg0: tensor<?x3xsi8>, %arg1: tensor<?x3xsi8>) -> () { | ||||
// CHECK: %[[AXIS:.+]] = arith.constant 0 | // CHECK: %[[AXIS:.+]] = arith.constant 0 | ||||
// CHECK: %[[STRIDE:.+]] = arith.constant 1 | // CHECK: %[[STRIDE:.+]] = arith.constant 1 | ||||
// CHECK: %[[OFFSET:.+]] = arith.constant 0 : index | // CHECK: %[[OFFSET:.+]] = arith.constant 0 : index | ||||
// CHECK: %[[IDX0:.+]] = arith.constant 0 : index | // CHECK: %[[IDX0:.+]] = arith.constant 0 : index | ||||
// CHECK: %[[SIZE:.+]] = tensor.dim %[[ARG0]], %[[IDX0]] | // CHECK: %[[SIZE:.+]] = tensor.dim %[[ARG0]], %[[IDX0]] | ||||
// CHECK: %[[IDX0_2:.+]] = arith.constant 0 : index | // CHECK: %[[IDX0_2:.+]] = arith.constant 0 : index | ||||
// CHECK: %[[DYN:.+]] = tensor.dim %[[ARG0]], %[[IDX0_2]] | // CHECK: %[[DYN:.+]] = tensor.dim %[[ARG0]], %[[IDX0_2]] | ||||
// CHECK: %[[IDX1:.+]] = arith.constant 1 : index | // CHECK: %[[IDX1:.+]] = arith.constant 1 : index | ||||
// CHECK: %[[INIT:.+]] = tensor.empty(%[[DYN]]) : tensor<?x3xf32> | // CHECK: %[[INIT:.+]] = tensor.empty(%[[DYN]]) : tensor<?x3xsi8> | ||||
// CHECK: %[[DYN1:.+]] = tensor.dim %[[ARG0]], %[[AXIS]] | // CHECK: %[[DYN1:.+]] = tensor.dim %[[ARG0]], %[[AXIS]] | ||||
// CHECK: %[[INSERT0:.+]] = tensor.insert_slice %[[ARG0]] into %[[INIT]][0, 0] [%[[DYN1]], 3] [1, 1] | // CHECK: %[[INSERT0:.+]] = tensor.insert_slice %[[ARG0]] into %[[INIT]][0, 0] [%[[DYN1]], 3] [1, 1] | ||||
// CHECK: %[[SUM:.+]] = arith.addi %[[OFFSET]], %[[DYN1]] | // CHECK: %[[SUM:.+]] = arith.addi %[[OFFSET]], %[[DYN1]] | ||||
// CHECK: %[[DYN2:.+]] = tensor.dim %[[ARG1]], %[[AXIS]] | // CHECK: %[[DYN2:.+]] = tensor.dim %[[ARG1]], %[[AXIS]] | ||||
// CHECK: %[[INSERT1:.+]] = tensor.insert_slice %[[ARG1]] into %[[INSERT0]][%[[SUM]], 0] [%[[DYN2]], 3] [1, 1] | // CHECK: %[[INSERT1:.+]] = tensor.insert_slice %[[ARG1]] into %[[INSERT0]][%[[SUM]], 0] [%[[DYN2]], 3] [1, 1] | ||||
%0 = "tosa.concat"(%arg0, %arg1) { axis = 0 : i64} : (tensor<?x3xf32>, tensor<?x3xf32>) -> (tensor<?x3xf32>) | %0 = "tosa.concat"(%arg0, %arg1) { axis = 0 : i64} : (tensor<?x3xsi8>, tensor<?x3xsi8>) -> (tensor<?x3xsi8>) | ||||
return | return | ||||
} | } |