// RUN: mlir-opt %s -allow-unregistered-dialect -pass-pipeline='builtin.module(test.symbol_scope_isolated(test-one-shot-module-bufferize))' -split-input-file | FileCheck %s "test.symbol_scope_isolated"() ({ // CHECK-LABEL: func @inner_func( // CHECK-SAME: %[[arg0:.*]]: memref) -> (tensor, f32) { // CHECK-NOT: copy %f = arith.constant 1.0 : f32 %c0 = arith.constant 0 : index %c1 = arith.constant 1 : index // CHECK: memref.store %{{.*}}, %[[arg0]] %0 = tensor.insert %f into %t[%c0] : tensor // CHECK: %[[load:.*]] = memref.load %[[arg0]] %1 = tensor.extract %0[%c1] : tensor // CHECK: return %[[arg0]], %[[load]] : memref, f32 return %0, %1 : tensor, f32 } // CHECK-LABEL: func @call_func_with_non_tensor_return( // CHECK-SAME: %[[arg0:.*]]: memref {bufferization.writable = true}) -> (f32, tensor) { // CHECK-NOT: alloc // CHECK-NOT: copy // CHECK: %[[call:.*]]:2 = call @inner_func(%[[arg0]]) %0, %1 = call @inner_func(%t0) : (tensor) -> (tensor, f32) // CHECK: return %[[call]]#1, %[[call]]#0 : f32, memref return %1, %0 : f32, tensor } "test.finish" () : () -> () }) : () -> () // ----- #enc1 = #test.tensor_encoding<"hello"> #enc2 = #test.tensor_encoding<"not hello"> "test.symbol_scope_isolated"() ({ // CHECK: func @inner_func( // CHECK-SAME: %[[arg0:.*]]: memref>) // CHECK-SAME: -> memref> func.func @inner_func(%t: tensor) -> tensor { // CHECK: return %[[arg0]] return %t : tensor } // CHECK: func @outer_func( // CHECK-SAME: %[[arg0:.*]]: memref>) // CHECK-SAME: -> (memref>, // CHECK-SAME: memref>) func.func @outer_func(%t0: tensor) -> (tensor, tensor) { // CHECK: %[[call:.*]] = call @inner_func(%[[arg0]]) %0 = call @inner_func(%t0) : (tensor) -> (tensor) // CHECK: %[[local:.*]] = "test.create_memref_op"() : () // CHECK-SAME: -> memref> %local = "test.create_tensor_op"() : () -> tensor // CHECK: %[[dummy:.*]] = "test.dummy_memref_op"(%[[local]]) %1 = "test.dummy_tensor_op"(%local) : (tensor) -> tensor // CHECK: return %[[call]], %[[dummy]] return %0, %1 : tensor, tensor } "test.finish" () : () -> () }) : () -> ()