/llvm-project/mlir/test/Dialect/Tosa/ |
H A D | tosa-infer-shapes.mlir | 4 func.func @test_return(%arg0 : tensor<4xf32>) -> tensor<*xf32> { 5 // CHECK: [[LOG:%.+]] = tosa.log %arg0 : (tensor<4xf32>) -> tensor<4xf32> 6 // CHECK: tensor.cast [[LOG]] : tensor<4xf32> to tensor<*xf32> 7 %0 = tosa.log %arg0 : (tensor<4xf32>) -> tensor<*xf32> 8 return %0 : tensor<*xf3 [all...] |
H A D | ops.mlir | 7 func.func @test_argmax(%arg0: tensor<14x19xf32>) -> tensor<14xi32> { 8 %0 = tosa.argmax %arg0 {axis = 1 : i32} : (tensor<14x19xf32>) -> tensor<14xi32> 9 return %0 : tensor<14xi32> 14 func.func @test_avg_pool2d_f32(%arg0: tensor<1x7x7x9xf32>) -> tensor<1x7x7x9xf32> { 15 %0 = tosa.avg_pool2d %arg0 {acc_type = f32, kernel = array<i64: 2, 2>, pad = array<i64: 0, 1, 0, 1>, stride = array<i64: 1, 1>} : (tensor<1x7x7x9xf32>) -> tensor<1x7x7x9xf32> 16 return %0 : tensor< [all...] |
H A D | canonicalize.mlir | 4 func.func @argmax_nofold(%arg0: tensor<?x1xf32>) -> tensor<?x1xi32> { 6 %0 = tosa.argmax %arg0 {axis = 0 : i32}: (tensor<?x1xf32>) -> tensor<?x1xi32> 7 return %0 : tensor<?x1xi32> 13 func.func @add_bcast_zero_int(%arg0: tensor<4x2x3xi32>) -> tensor<4x2x3xi32> { 16 %zeros = "tosa.const"() {value = dense<0> : tensor<1x1x1xi32>} : () -> tensor<1x1x1xi32> 17 %1 = tosa.add %arg0, %zeros : (tensor< [all...] |
H A D | level_check.mlir | 8 func.func @test_argmax(%arg0: tensor<1x1x1x1x29x29x4xf32>) -> tensor<1x1x1x1x29x4xi32> { 10 %0 = "tosa.argmax"(%arg0) {axis = 4 : i32} : (tensor<1x1x1x1x29x29x4xf32>) -> tensor<1x1x1x1x29x4xi32> 11 return %0 : tensor<1x1x1x1x29x4xi32> 16 func.func @test_reduce_all(%arg0: tensor<1x1x1x1x13x21x3xi1>) -> tensor<1x1x1x1x1x21x3xi1> { 18 %0 = "tosa.reduce_all"(%arg0) {axis = 4 : i32} : (tensor<1x1x1x1x13x21x3xi1>) -> tensor<1x1x1x1x1x21x3xi1> 19 return %0 : tensor< [all...] |
H A D | inlining.mlir | 10 func.func @inlined_if_fn(%arg0: tensor<f32>, %arg1: tensor<f32>, %arg2: tensor<i1>) -> tensor<f32> { 12 ^bb0(%arg3: tensor<f32>, %arg4: tensor<f32>): 13 %1 = call @add(%arg3, %arg4) : (tensor<f32>, tensor<f32>) -> tensor<f32> 14 "tosa.yield"(%1) : (tensor<f3 [all...] |
H A D | invalid.mlir | 2 // Test expected errors in terms of the shape and type of tensor, and the argument type of 10 func.func @test_const() -> tensor<1xf32> { 12 %0 = "tosa.const"() {value = dense<1> : tensor<1xi32>} : () -> tensor<1xf32> 13 return %0 : tensor<1xf32> 20 %0 = "tosa.const"() {value = dense<1.0> : vector<f32>} : () -> tensor<f32> 26 func.func @test_conv2d(%arg0: tensor<1x29x29x4xf32>, %arg1: tensor<16x3x3x4xi8>, %arg2: tensor<16xi8>) -> tensor< [all...] |
H A D | constant-op-fold.mlir | 7 func.func @armax_fold_dim_size_1(%arg0: tensor<2x1x3xf32>) -> tensor<2x3xi32> { 8 // CHECK: "tosa.const"() <{value = dense<0> : tensor<2x3xi32>}> : () -> tensor<2x3xi32> 9 %0 = tosa.argmax %arg0 {axis = 1 : i32}: (tensor<2x1x3xf32>) -> tensor<2x3xi32> 10 return %0 : tensor<2x3xi32> 14 func.func @argmax_dynamic_shape_no_fold_dim_size_1(%arg0: tensor<?x1x3xf32>) -> tensor<?x3xi32> { 16 %0 = tosa.argmax %arg0 {axis = 1 : i32}: (tensor< [all...] |
H A D | fold_concats.mlir | 3 func.func @single_concat(%arg0: tensor<1x1x7x7xf32>) -> tensor<1x2x7x7xf32> { 4 …%0 = tosa.concat %arg0, %arg0 {axis = 1 : i32} : (tensor<1x1x7x7xf32>, tensor<1x1x7x7xf32>) -> ten… 5 return %0 : tensor<1x2x7x7xf32> 9 // CHECK-SAME: %[[VAL_0:.*]]: tensor<1x1x7x7xf32>) -> tensor<1x2x7x7xf3… 10 ….concat %[[VAL_0]], %[[VAL_0]] {axis = 1 : i32} : (tensor<1x1x7x7xf32>, tensor<1x1x7x7xf32>) -> te… 11 // CHECK: return %[[VAL_1]] : tensor<1x2x7x7xf32> 16 func.func @concat_different_axis(%arg0: tensor<1x1x7x7xf32>) -> tensor<2x2x7x7xf32> { 17 …%0 = tosa.concat %arg0, %arg0 {axis = 1 : i32} : (tensor<1x1x7x7xf32>, tensor<1x1x7x7xf32>) -> ten… 18 …%1 = tosa.concat %0, %0 {axis = 0 : i32} : (tensor<1x2x7x7xf32>, tensor<1x2x7x7xf32>) -> tensor<2x… 19 return %1 : tensor<2x2x7x7xf32> [all …]
|
/llvm-project/mlir/test/Dialect/Tensor/ |
H A D | simplify-pack-unpack.mlir | 1 // RUN: mlir-opt -split-input-file -test-tensor-transform-patterns="test-simplify-pack-unpack-patte… 4 // CHECK-SAME: %[[ARG0:.+]]: tensor<256xf32>) 5 …: %[[EXPANDED:.+]] = tensor.expand_shape %[[ARG0]] {{\[}}[0, 1]] output_shape [8, 32] : te… 6 // CHECK: return %[[EXPANDED]] : tensor<8x32xf32> 7 func.func @single_dim_packing(%arg0: tensor<256xf32>) -> tensor<8x32xf32> { 8 %empty = tensor.empty() : tensor<8x32xf32> 9 …%0 = tensor.pack %arg0 inner_dims_pos = [0] inner_tiles = [32] into %empty : tensor<256xf32> -> te… 10 return %0 : tensor<8x32xf32> 16 // CHECK-SAME: %[[ARG0:.+]]: tensor<255xf32>) 17 // CHECK-NOT: tensor.expand_shape [all …]
|
H A D | invalid.mlir | 4 func.func @dim_0_ranked(%arg : tensor<f32>, %arg1 : index) { 5 tensor.dim %arg, %arg1 : tensor<f32> // expected-error {{'tensor.dim' op operand #0 must be non-0-ranked or unranked tensor, but got 'tensor<f32>'}} 11 func.func @tensor.cast_mismatching_constants(%arg0: tensor<1xf32>) { 12 // expected-error@+1 {{operand type 'tensor<1xf32>' and result type 'tensor< [all...] |
H A D | ops.mlir | 4 func.func @cast(%arg0: tensor<*xf32>, %arg1 : tensor<4x4xf32>, %arg2: tensor<?x?xf32>) { 5 // CHECK: tensor.cast %{{.*}} : tensor<*xf32> to tensor<?x?xf32> 6 %0 = tensor.cast %arg0 : tensor<*xf32> to tensor<?x?xf32> 7 // CHECK: tensor.cast %{{.*}} : tensor<4x4xf32> to tensor<*xf32> 8 %1 = tensor.cast %arg1 : tensor<4x4xf32> to tensor<*xf32> 9 // CHECK: tensor.cast %{{.*}} : tensor<?x?xf32> to tensor<4x?xf32> 10 %2 = tensor.cast %arg2 : tensor<?x?xf32> to tensor<4x?xf32> 11 // CHECK: tensor.cast %{{.*}} : tensor<4x?xf32> to tensor<?x?xf32> 12 %3 = tensor.cast %2 : tensor<4x?xf32> to tensor<?x?xf32> 19 func.func @concat(%arg0: tensor<4x7x3xf32>, %arg1 : tensor<4x4x3xf32>, %arg2: tensor<?x?x?xf32>) { [all …]
|
H A D | canonicalize.mlir | 6 func.func @expand_shape_identity_fold(%arg0 : tensor<5xf32>) -> tensor<5xf32> { 7 %0 = tensor.expand_shape %arg0 [[0]] output_shape [5] : tensor<5xf32> into tensor<5xf32> 8 return %0 : tensor<5xf32> 15 func.func @expand_shape_rank0_identity_fold(%arg0 : tensor<f32>) -> tensor<f32> { 16 %0 = tensor.expand_shape %arg0 [] output_shape [] : tensor<f3 [all...] |
H A D | fold-into-pack-and-unpack.mlir | 1 // RUN: mlir-opt -split-input-file -test-tensor-transform-patterns=test-fold-into-pack-and-unpack %s | FileCheck %s 3 func.func @fold_unpack_slice(%arg0 : tensor<?x?x8x4xf32>, %arg1 : tensor<?x?xf32>, 4 %arg2 : index, %arg3 : index) -> tensor<?x?xf32> { 5 %0 = tensor.unpack %arg0 inner_dims_pos = [0, 1] inner_tiles = [8, 4] into %arg1 6 : tensor<?x?x8x4xf32> -> tensor<?x?xf32> 7 %1 = tensor.extract_slice %0[0, 0] [%arg2, %arg3] [1, 1] : tensor<?x?xf32> to tensor< [all...] |
/llvm-project/mlir/test/Dialect/ |
H A D | traits.mlir | 6 func.func @broadcast_scalar_scalar_scalar(tensor<i32>, tensor<i32>) -> tensor<i32> { 7 ^bb0(%arg0: tensor<i32>, %arg1: tensor<i32>): 8 %0 = "test.broadcastable"(%arg0, %arg1) : (tensor<i32>, tensor<i32>) -> tensor<i32> 9 return %0 : tensor<i32> 14 func.func @broadcast_tensor_scalar_tensor(tensor<4xi32>, tensor<i32>) -> tensor<4xi32> { 15 ^bb0(%arg0: tensor<4xi32>, %arg1: tensor<i32>): 16 %0 = "test.broadcastable"(%arg0, %arg1) : (tensor<4xi32>, tensor<i32>) -> tensor<4xi32> 17 return %0 : tensor<4xi32> 23 func.func @broadcast_tensor_tensor_tensor(tensor<4x3x2xi32>, tensor<3x1xi32>) -> tensor<4x3x2xi32> { 24 ^bb0(%arg0: tensor<4x3x2xi32>, %arg1: tensor<3x1xi32>): [all …]
|
/llvm-project/mlir/test/Dialect/Linalg/ |
H A D | transpose-conv2d.mlir | 4 …CK-SAME: (%[[INPUT:.+]]: tensor<1x4x4x6xf64>, %[[FILTER:.+]]: tensor<8x2x2x6xf64>, %[[INIT:.+]]: t… 5 // CHECK-DAG: %[[NEWF:.+]] = tensor.empty() : tensor<2x2x6x8xf64> 6 …[[TRANSPOSE:.+]] = linalg.transpose ins(%[[FILTER]] : tensor<8x2x2x6xf64>) outs(%[[NEWF]] : tensor… 7 …tensor<2xi64>, strides = dense<2> : tensor<2xi64>} ins(%[[INPUT]], %[[TRANSPOSE]] : tensor<1x4x4x6… 8 // CHECK: return %[[CONV]] : tensor<1x2x2x8xf64> 9 … @conv_2d_nhwc_fhwc_f64(%input: tensor<1x4x4x6xf64>, %filter: tensor<8x2x2x6xf64>, %init: tensor<1… 10 %0 = linalg.conv_2d_nhwc_fhwc {dilations = dense<1> : tensor<2xi64>, 11 strides = dense<2> : tensor<2xi64>} 12 ins (%input, %filter: tensor<1x4x4x6xf64>, tensor<8x2x2x6xf64>) 13 outs (%init: tensor<1x2x2x8xf64>) -> tensor<1x2x2x8xf64> [all …]
|
H A D | canonicalize.mlir | 30 func.func @dce_zero_memref(%arg0 : memref<0xf32>, %arg1: tensor<0xf32>) -> tensor<0xf32> { 34 // tensor<0xf32> cannot be dce'ed 35 %1 = linalg.generic #trait outs(%arg1 : tensor<0xf32>) { 38 } -> tensor<0xf32> 40 return %1: tensor<0xf32> 44 // CHECK-SAME: %[[ARG1:[a-zA-Z0-9_]+]]: tensor<0xf32> 60 // CHECK-LABEL: func @tensor.cast( 61 func.func @tensor.cast(%a : tensor< [all...] |
H A D | generalize-named-polymorphic-ops.mlir | 4 func.func @generalize_matmul_tensor_f16f64f32(%A : tensor<16x8xf16>, %B: tensor<8x32xf64>, %C: tensor<16x32xf32>) -> tensor<16x32xf32> { 5 %0 = linalg.matmul ins(%A, %B: tensor<16x8xf16>, tensor<8x32xf64>) 6 outs(%C: tensor<16x32xf32>) -> tensor<16x32xf32> 7 return %0: tensor<16x32xf32> 18 // CHECK-NEXT: -> tensor<1 [all...] |
H A D | one-shot-bufferize-analysis-2fill-extract-matmul-all-perms.mlir | 10 …%arg0: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 11 …%arg1: tensor<518x518xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 12 …%arg2: tensor<256x256xf32> {bufferization.buffer_layout = affine_map<(d0, d1) -> (d0, d1)>, buffer… 13 -> tensor<256x256xf32> 18 %0 = bufferization.alloc_tensor() : tensor<256x256xf32> 21 %1 = linalg.fill ins(%cst : f32) outs(%0 : tensor<256x256xf32>) -> tensor<256x256xf32> 23 %2 = linalg.fill ins(%cst_0 : f32) outs(%0 : tensor<256x256xf32>) -> tensor<256x256xf32> 25 %3 = tensor.extract_slice %1[0, 0] [256, 16] [1, 1] : tensor<256x256xf32> to tensor<256x16xf32> 27 %4 = tensor.extract_slice %2[0, 0] [16, 256] [1, 1] : tensor<256x256xf32> to tensor<16x256xf32> 29 …%5 = linalg.matmul ins(%3, %4 : tensor<256x16xf32>, tensor<16x256xf32>) outs(%arg2 : tensor<256x25… [all …]
|
H A D | subtensor-of-padtensor.mlir | 4 // CHECK-SAME: %[[ARG0:.*]]: tensor<4x5xf32> 5 // CHECK: %[[RESULT:.*]] = tensor.extract_slice %[[ARG0]][1, 2] [2, 1] [1, 1] : tensor<4x5x… 7 func.func @static_data_only(%arg0 : tensor<4x5xf32>, %pad : f32) 8 -> tensor<2x1xf32> { 9 %0 = tensor.pad %arg0 low[0, 0] high[7, 8] { 11 tensor.yield %pad : f32 12 } : tensor<4x5xf32> to tensor<11x13xf32> 13 %1 = tensor.extract_slice %0[1, 2] [2, 1] [1, 1] : tensor<11x13xf32> to tensor<2x1xf32> 14 return %1 : tensor<2x1xf32> 20 // CHECK-SAME: %[[ARG0:.*]]: tensor<4x5xf32>, %[[PAD:.*]]: f32 [all …]
|
H A D | continuous-tiling-multiway-split.mlir | 17 %arg0: tensor<25x34xf32>, %arg1: tensor<34x25xf32>, %arg2: tensor<25x25xf32>) 18 -> tensor<25x25xf32> { 19 %0 = linalg.matmul ins(%arg0, %arg1: tensor<25x34xf32>, tensor<34x25xf32>) 20 outs(%arg2: tensor<25x25xf32>) 21 -> tensor<25x25xf32> 23 return %0 : tensor<25x25xf32> 27 // CHECK-SAME: %[[IN1:.+]]: tensor<2 [all...] |
H A D | data-layout-propagation.mlir | 4 func.func @dynamic_elem_pack(%arg0: tensor<?x?xf32>, %dest: tensor<?x?x8x2xf32>) -> tensor<?x?x8x2xf32> 8 %0 = tensor.dim %arg0, %c0 : tensor<?x?xf32> 9 %1 = tensor.dim %arg0, %c1 : tensor<?x?xf32> 10 %2 = tensor.empty(%0, %1) : tensor<?x?xf32> 12 ins(%arg0 : tensor< [all...] |
/llvm-project/mlir/test/IR/ |
H A D | repro_b120295301.mlir | 3 func.func @testType(tensor<1x224x224x3xf32>) -> tensor<96xf32> { 4 ^bb0(%arg0: tensor<1x224x224x3xf32>): 5 %1 = "arith.constant"() {value = dense<0.1> : tensor<1xf32>} : () -> (tensor<1xf32>) 6 %2 = "arith.constant"() {value = dense<0.1> : tensor<2xf32>} : () -> (tensor<2xf32>) 7 %3 = "arith.constant"() {value = dense<0.1> : tensor<3xf32>} : () -> (tensor<3xf32>) 8 %4 = "arith.constant"() {value = dense<0.1> : tensor<4xf32>} : () -> (tensor<4xf32>) 9 %5 = "arith.constant"() {value = dense<0.1> : tensor<5xf32>} : () -> (tensor<5xf32>) 10 %6 = "arith.constant"() {value = dense<0.1> : tensor<6xf32>} : () -> (tensor<6xf32>) 11 %7 = "arith.constant"() {value = dense<0.1> : tensor<7xf32>} : () -> (tensor<7xf32>) 12 %8 = "arith.constant"() {value = dense<0.1> : tensor<8xf32>} : () -> (tensor<8xf32>) [all …]
|
/llvm-project/mlir/test/Integration/Dialect/Memref/ |
H A D | verify-memref.mlir |
|
/llvm-project/mlir/test/Dialect/Bufferization/Transforms/ |
H A D | one-shot-module-bufferize-analysis.mlir | 23 func.func @extract_slice_fun(%A : tensor<?xf32> {bufferization.writable = false}, 25 %B : tensor<?xf32> {bufferization.writable = true}) 27 -> (tensor<4xf32>, tensor<8xf32>) 29 // tensor.extract_slice is not used in a write, it is not compelled to 33 // CHECK: tensor.extract_slice 35 %r0 = tensor.extract_slice %A[0][4][1] : tensor<?xf32> to tensor<4xf32> 37 // CHECK: tensor [all...] |
/llvm-project/mlir/test/Conversion/TosaToTensor/ |
H A D | tosa-to-tensor.mlir | 1 // RUN: mlir-opt --split-input-file --tosa-to-tensor %s -o -| FileCheck %s 6 // CHECK-SAME: %[[ARG_0:[a-zA-Z0-9_]+]]: tensor<f32> 7 // CHECK: return %[[ARG_0]] : tensor<f32> 8 func.func @test_reshape_0d_same_s2s_explicit(%arg0: tensor<f32>) -> tensor<f32> { 9 %0 = "tosa.reshape"(%arg0) {new_shape = array<i64>} : (tensor<f32>) -> tensor<f32> 10 return %0 : tensor<f32> 16 // CHECK-SAME: %[[ARG_0:[a-zA-Z0-9_]+]]: tensor<f32> 17 // CHECK: %[[VAL_0:.*]] = tensor [all...] |