xref: /llvm-project/mlir/test/Dialect/GPU/bufferization-buffer-deallocation.mlir (revision fbb62d449c47bb0b49c0727c926373b41a8183c5)
1522c1d0eSMartin Erhart// RUN: mlir-opt %s -buffer-deallocation-pipeline --allow-unregistered-dialect | FileCheck %s
2522c1d0eSMartin Erhart
3522c1d0eSMartin Erhartfunc.func @gpu_launch() {
4522c1d0eSMartin Erhart  %c1 = arith.constant 1 : index
5522c1d0eSMartin Erhart  gpu.launch blocks(%arg0, %arg1, %arg2) in (%arg6 = %c1, %arg7 = %c1, %arg8 = %c1)
6522c1d0eSMartin Erhart    threads(%arg3, %arg4, %arg5) in (%arg9 = %c1, %arg10 = %c1, %arg11 = %c1) {
7522c1d0eSMartin Erhart    %alloc = memref.alloc() : memref<2xf32>
8*fbb62d44SMatthias Springer    "test.read_buffer"(%alloc) : (memref<2xf32>) -> ()
9522c1d0eSMartin Erhart    gpu.terminator
10522c1d0eSMartin Erhart  }
11522c1d0eSMartin Erhart  return
12522c1d0eSMartin Erhart}
13522c1d0eSMartin Erhart
14522c1d0eSMartin Erhart// CHECK-LABEL: func @gpu_launch
15522c1d0eSMartin Erhart//       CHECK:   gpu.launch
16522c1d0eSMartin Erhart//       CHECK:     [[ALLOC:%.+]] = memref.alloc(
17522c1d0eSMartin Erhart//       CHECK:     memref.dealloc [[ALLOC]]
18522c1d0eSMartin Erhart//       CHECK:     gpu.terminator
19