Changeset View
Changeset View
Standalone View
Standalone View
mlir/test/Dialect/Linalg/canonicalize.mlir
Show First 20 Lines • Show All 887 Lines • ▼ Show 20 Lines | %3 = linalg.pad_tensor %arg2 low[%c0, %c0] high[%high, %high] { | ||||
^bb0(%arg9: index, %arg10: index): // no predecessors | ^bb0(%arg9: index, %arg10: index): // no predecessors | ||||
linalg.yield %cst : f32 | linalg.yield %cst : f32 | ||||
} : tensor<?x?xf32> to tensor<2x4xf32> | } : tensor<?x?xf32> to tensor<2x4xf32> | ||||
return | return | ||||
} | } | ||||
// ----- | // ----- | ||||
// CHECK-LABEL: func @pad_tensor_same_static_shape( | |||||
// CHECK-SAME: %[[ARG0:.*]]: tensor<5x6xf32> | |||||
// CHECK-NOT: linalg.pad_tensor | |||||
// CHECK: return %[[ARG0]] | |||||
func @pad_tensor_same_static_shape(%arg0: tensor<5x6xf32>, %a: index) | |||||
-> tensor<5x6xf32> { | |||||
%cst = constant 0.000000e+00 : f32 | |||||
%0 = linalg.pad_tensor %arg0 low[%a, 0] high[0, %a] { | |||||
^bb0(%arg1: index, %arg2: index): | |||||
linalg.yield %cst : f32 | |||||
} : tensor<5x6xf32> to tensor<5x6xf32> | |||||
return %0 : tensor<5x6xf32> | |||||
} | |||||
// ----- | |||||
func @dim_reshape_expansion(%arg0 : tensor<6x5x?xf32>) -> (index, index, index) | func @dim_reshape_expansion(%arg0 : tensor<6x5x?xf32>) -> (index, index, index) | ||||
{ | { | ||||
%c1 = constant 1 : index | %c1 = constant 1 : index | ||||
%c3 = constant 3 : index | %c3 = constant 3 : index | ||||
%c4 = constant 4 : index | %c4 = constant 4 : index | ||||
%0 = linalg.tensor_expand_shape %arg0 [[0, 1], [2], [3, 4, 5]] | %0 = linalg.tensor_expand_shape %arg0 [[0, 1], [2], [3, 4, 5]] | ||||
: tensor<6x5x?xf32> into tensor<2x3x5x4x?x7xf32> | : tensor<6x5x?xf32> into tensor<2x3x5x4x?x7xf32> | ||||
%1 = memref.dim %0, %c1 : tensor<2x3x5x4x?x7xf32> | %1 = memref.dim %0, %c1 : tensor<2x3x5x4x?x7xf32> | ||||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |