24 lines · plain
1// RUN: mlir-opt --test-single-fold %s | FileCheck %s2 3// CHECK-LABEL: func @test_const4func.func @test_const(%arg0 : index) -> tensor<4xi32> {5 // CHECK: tosa.const6 %0 = "tosa.const"() {values = dense<[3, 0, 1, 2]> : tensor<4xi32>} : () -> tensor<4xi32>7 return %0 : tensor<4xi32>8}9 10// CHECK-LABEL: func @test_const_i6411func.func @test_const_i64(%arg0 : index) -> tensor<4xi64> {12 // CHECK: tosa.const13 %0 = "tosa.const"() {values = dense<[3, 0, 1, 2]> : tensor<4xi64>} : () -> tensor<4xi64>14 return %0 : tensor<4xi64>15}16 17// CHECK-LABEL: func @try_fold_equal_with_unranked_tensor18func.func @try_fold_equal_with_unranked_tensor(%arg0: tensor<4xi32>, %arg1: tensor<1xi32>) {19 // CHECK: tosa.equal20 // CHECK-NEXT: return21 %0 = tosa.equal %arg0, %arg1 : (tensor<4xi32>, tensor<1xi32>) -> tensor<*xi1>22 return23}24