brintos

brintos / llvm-project-archived public Read only

0
0
Text · 900 B · eaf6625 Raw
21 lines · plain
1// RUN: mlir-opt %s -buffer-deallocation-pipeline | FileCheck %s2// RUN: mlir-opt %s --pass-pipeline="builtin.module(buffer-deallocation-pipeline)" | FileCheck %s3 4// Test case requires a helper function.5 6// CHECK-LABEL: func.func @test(7//       CHECK:   func.call @[[helper:.*]]({{.*}}) : ({{.*}}) -> ()8func.func @test(%lb : index, %ub: index) -> (memref<5xf32>, memref<5xf32>) {9  %0 = memref.alloc() : memref<5xf32>10  %1 = memref.alloc() : memref<5xf32>11  %c1 = arith.constant 1 : index12  %a, %b = scf.for %iv = %lb to %ub step %c1 iter_args(%c = %0, %d = %1)13      -> (memref<5xf32>, memref<5xf32>) {14    scf.yield %d, %c : memref<5xf32>, memref<5xf32>15  }16  return %a, %b : memref<5xf32>, memref<5xf32>17}18 19//      CHECK: func.func private @[[helper]](20// CHECK-SAME:     %{{.*}}: memref<?xindex>, %{{.*}}: memref<?xindex>, %{{.*}}: memref<?xi1>, %{{.*}}: memref<?xi1>, %{{.*}}: memref<?xi1>)21