// RUN: npcomp-opt -lower-to-memref-abi <%s | FileCheck %s --dump-input=fail // CHECK-LABEL: func @identity func @identity(%arg0: tensor) -> tensor { // CHECK: return %arg0 : memref<*xf32> return %arg0 : tensor } // CHECK-LABEL: func @basic( // CHECK-SAME: %[[VAL_1:.*]]: memref<*xf32>) -> memref<*xf32> { func @basic(%arg0: tensor) -> tensor { // CHECK: %[[VAL_2:.*]] = memref_cast %[[VAL_1]] : memref<*xf32> to memref // CHECK: %[[VAL_3:.*]] = dim %[[VAL_2]], 0 : memref // CHECK: %[[VAL_4:.*]] = "tcp.shape_from_extents"(%[[VAL_3]]) : (index) -> !shape.shape %shape = shape.shape_of %arg0 : tensor // CHECK: %[[VAL_5:.*]] = tcp.alloc_memref %[[VAL_4]] : memref %memref = tcp.alloc_memref %shape : memref // CHECK: %[[VAL_6:.*]] = memref_cast %[[VAL_1]] : memref<*xf32> to memref // CHECK: linalg.copy(%[[VAL_6]], %[[VAL_5]]) : memref, memref tensor_store %arg0, %memref : memref // CHECK: %[[VAL_7:.*]] = memref_cast %[[VAL_5]] : memref to memref<*xf32> %ret = tensor_load %memref : memref // CHECK: return %[[VAL_7]] : memref<*xf32> return %ret: tensor }