Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Dialect/Linalg/comprehensive-module-bufferize.mlir
Show First 20 Lines • Show All 915 Lines • ▼ Show 20 Lines | %r = scf.for %iv = %c0 to %c10 step %c1 iter_args(%bb = %t1) -> (tensor<?xf32>) { | ||||
} | } | ||||
scf.yield %r2 : tensor<?xf32> | scf.yield %r2 : tensor<?xf32> | ||||
} | } | ||||
return %r : tensor<?xf32> | return %r : tensor<?xf32> | ||||
} | } | ||||
// ----- | // ----- | ||||
// CHECK-LABEL: func @scf_if_non_equiv_yields( | |||||
// CHECK-SAME: %[[cond:.*]]: i1, %[[A:.*]]: memref<{{.*}}>, %[[B:.*]]: memref<{{.*}}>) -> memref<{{.*}}> | |||||
func @scf_if_non_equiv_yields(%b : i1, %A : tensor<4xf32>, %B : tensor<4xf32>) -> tensor<4xf32> | |||||
{ | |||||
// CHECK: %[[r:.*]] = select %[[cond]], %[[A]], %[[B]] | |||||
%r = scf.if %b -> (tensor<4xf32>) { | |||||
scf.yield %A : tensor<4xf32> | |||||
} else { | |||||
scf.yield %B : tensor<4xf32> | |||||
} | |||||
// CHECK: return %[[r]] | |||||
return %r: tensor<4xf32> | |||||
} | |||||
// ----- | |||||
// CHECK-LABEL: func @insert_op | // CHECK-LABEL: func @insert_op | ||||
// CHECK-SAME: %[[t1:.*]]: memref<?xf32, {{.*}}>, %[[s:.*]]: f32, %[[i:.*]]: index | // CHECK-SAME: %[[t1:.*]]: memref<?xf32, {{.*}}>, %[[s:.*]]: f32, %[[i:.*]]: index | ||||
func @insert_op(%t1 : tensor<?xf32> {linalg.inplaceable = true}, | func @insert_op(%t1 : tensor<?xf32> {linalg.inplaceable = true}, | ||||
%s : f32, %i : index) -> tensor<?xf32> { | %s : f32, %i : index) -> tensor<?xf32> { | ||||
// CHECK: memref.store %[[s]], %[[t1]][%[[i]]] | // CHECK: memref.store %[[s]], %[[t1]][%[[i]]] | ||||
%0 = tensor.insert %s into %t1[%i] : tensor<?xf32> | %0 = tensor.insert %s into %t1[%i] : tensor<?xf32> | ||||
// CHECK: return | // CHECK: return | ||||
return %0 : tensor<?xf32> | return %0 : tensor<?xf32> | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |