brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · ecf4f75 Raw
32 lines · plain
1// RUN: mlir-opt %s --split-input-file --pass-pipeline="builtin.module(func.func(test-acc-pointer-like-interface{test-mode=free}))" 2>&1 | FileCheck %s2 3func.func @test_static_memref_free() {4  %0 = memref.alloca() {test.ptr} : memref<10x20xf32>5  // CHECK: Successfully generated free for operation: %[[ORIG:.*]] = memref.alloca() {test.ptr} : memref<10x20xf32>6  // CHECK-NOT: Generated7  return8}9 10// -----11 12func.func @test_dynamic_memref_free() {13  %c10 = arith.constant 10 : index14  %c20 = arith.constant 20 : index15  %orig = memref.alloc(%c10, %c20) {test.ptr} : memref<?x?xf32>16  17  // CHECK: Successfully generated free for operation: %[[ORIG:.*]] = memref.alloc(%[[C10:.*]], %[[C20:.*]]) {test.ptr} : memref<?x?xf32>18  // CHECK: Generated: memref.dealloc %[[ORIG]] : memref<?x?xf32>19  return20}21 22// -----23 24func.func @test_cast_walking_free() {25  %0 = memref.alloca() : memref<10x20xf32>26  %1 = memref.cast %0 {test.ptr} : memref<10x20xf32> to memref<?x?xf32>27  28  // CHECK: Successfully generated free for operation: %[[CAST:.*]] = memref.cast %[[ALLOCA:.*]] {test.ptr} : memref<10x20xf32> to memref<?x?xf32>29  // CHECK-NOT: Generated30  return31}32