// RUN: npcomp-opt <%s | npcomp-opt | FileCheck %s --dump-input=fail // CHECK-LABEL: tcp.global @foo dense<0.0{{.*}}> : tensor<10xf32> tcp.global @foo dense<0.0> : tensor<10xf32> // CHECK-LABEL: func @global func @global() { // CHECK: tcp.get_global_memref @foo : memref<10xf32> %0 = tcp.get_global_memref @foo : memref<10xf32> return } // CHECK-LABEL: func @binary_elementwise func @binary_elementwise(%arg0: tensor, %arg1: tensor, %arg2: i32) { // CHECK: tcp.add %arg0, %arg1 : (tensor, tensor) -> tensor // CHECK: tcp.max %arg0, %arg1 : (tensor, tensor) -> tensor %0 = tcp.add %arg0, %arg1 : (tensor, tensor) -> tensor %1 = tcp.max %arg0, %arg1 : (tensor, tensor) -> tensor return } // CHECK-LABEL: func @matmul func @matmul(%arg0: tensor, %arg1: tensor) -> tensor { // CHECK: tcp.matmul %arg0, %arg1 : (tensor, tensor) -> tensor %0 = tcp.matmul %arg0, %arg1 : (tensor, tensor) -> tensor return %0 : tensor } // CHECK-LABEL: func @shaped_results // CHECK-NEXT: %[[RET:.*]] = tcp.shaped_results %arg1 { // CHECK-NEXT: %[[VAL:.*]] = // CHECK-NEXT: tcp.yield %[[VAL]] : tensor // CHECK-NEXT: } : tensor -> tensor // CHECK-NEXT: return %[[RET]] : tensor // CHECK-NEXT: } func @shaped_results(%arg0: tensor, %arg1: tensor) -> tensor { %add = tcp.shaped_results %arg1 { %0 = tcp.add %arg0, %arg0 : (tensor, tensor) -> tensor tcp.yield %0 : tensor } : tensor -> tensor return %add : tensor }