brintos

brintos / llvm-project-archived public Read only

0
0
Text · 743 B · de5fe3b Raw
20 lines · plain
1// RUN: mlir-opt %s -inline | FileCheck %s2 3// CHECK-LABEL: func @test_inline4// CHECK-SAME: (%[[ARG:.*]]: memref<*xf32>)5// CHECK-NOT: call6// CHECK: %[[RES:.*]] = bufferization.clone %[[ARG]]7// CHECK: bufferization.dealloc8// CHECK: return %[[RES]]9func.func @test_inline(%buf : memref<*xf32>) -> (memref<*xf32>, i1) {10  %0:2 = call @inner_func(%buf) : (memref<*xf32>) -> (memref<*xf32>, i1)11  return %0#0, %0#1 : memref<*xf32>, i112}13 14func.func @inner_func(%buf : memref<*xf32>) -> (memref<*xf32>, i1) {15  %true = arith.constant true16  %clone = bufferization.clone %buf : memref<*xf32> to memref<*xf32>17  %0 = bufferization.dealloc (%buf : memref<*xf32>) if (%true) retain (%clone : memref<*xf32>)18  return %clone, %0 : memref<*xf32>, i119}20