1
- // RUN: mlir-opt %s -one-shot-bufferize="bufferize-function-boundaries allow-return-allocs function-boundary-type-conversion=fully-dynamic-layout-map" -drop-equivalent-buffer-results -buffer-results-to-out-params -buffer-deallocation - split-input-file | FileCheck %s
2
- // RUN: mlir-opt %s -one-shot-bufferize="bufferize-function-boundaries allow-return-allocs function-boundary-type-conversion=identity-layout-map" -drop-equivalent-buffer-results -buffer-results-to-out-params -buffer-deallocation - split-input-file | FileCheck %s --check-prefix=CHECK-NO-LAYOUT
3
- // RUN: mlir-opt %s -one-shot-bufferize="bufferize-function-boundaries allow-return-allocs function-boundary-type-conversion=infer-layout-map" -drop-equivalent-buffer-results -buffer-deallocation - split-input-file | FileCheck %s --check-prefix=CHECK-BASELINE
1
+ // RUN: mlir-opt %s -one-shot-bufferize="bufferize-function-boundaries allow-return-allocs function-boundary-type-conversion=fully-dynamic-layout-map" -drop-equivalent-buffer-results -buffer-results-to-out-params -split-input-file | FileCheck %s
2
+ // RUN: mlir-opt %s -one-shot-bufferize="bufferize-function-boundaries allow-return-allocs function-boundary-type-conversion=identity-layout-map" -drop-equivalent-buffer-results -buffer-results-to-out-params -split-input-file | FileCheck %s --check-prefix=CHECK-NO-LAYOUT
3
+ // RUN: mlir-opt %s -one-shot-bufferize="bufferize-function-boundaries allow-return-allocs function-boundary-type-conversion=infer-layout-map" -drop-equivalent-buffer-results -split-input-file | FileCheck %s --check-prefix=CHECK-BASELINE
4
4
5
5
// Note: function-boundary-type-conversion=infer-layout-map with
6
6
// promote-buffer-results-to-out-params is an unsupported combination.
18
18
// CHECK: memref.store %{{.*}}, %[[alloc]]
19
19
// CHECK: %[[casted:.*]] = memref.cast %[[alloc]]
20
20
// CHECK: memref.copy %[[casted]], %[[arg1]]
21
- // CHECK: memref.dealloc %[[alloc]]
22
21
// CHECK: return
23
22
// CHECK: }
24
23
29
28
// CHECK-NO-LAYOUT: memref.copy %[[arg0]], %[[alloc]]
30
29
// CHECK-NO-LAYOUT: memref.store {{.*}}, %[[alloc]]
31
30
// CHECK-NO-LAYOUT: memref.copy %[[alloc]], %[[arg1]]
32
- // CHECK-NO-LAYOUT: memref.dealloc %[[alloc]]
33
31
34
32
// CHECK-BASELINE-LABEL: func @callee(
35
33
// CHECK-BASELINE-SAME: %[[arg0:.*]]: memref<5xf32, strided<[?], offset: ?>>) -> memref<5xf32> {
@@ -53,7 +51,6 @@ func.func @callee(%t: tensor<5xf32>) -> (tensor<5xf32>, tensor<5xf32>) {
53
51
// CHECK: call @callee(%[[arg0]], %[[casted]])
54
52
// CHECK: %[[l1:.*]] = memref.load %[[arg0]]
55
53
// CHECK: %[[l2:.*]] = memref.load %[[casted]]
56
- // CHECK: memref.dealloc %[[alloc]]
57
54
// CHECK: return %[[l1]], %[[l2]]
58
55
// CHECK: }
59
56
@@ -78,7 +75,6 @@ func.func @main(%t: tensor<5xf32>) -> (f32, f32) {
78
75
// CHECK: %[[subview:.*]] = memref.subview %[[alloc]]{{.*}} : memref<10x20xf32> to memref<2x5xf32, strided<[20, 1], offset: ?>>
79
76
// CHECK: %[[casted:.*]] = memref.cast %[[subview]]
80
77
// CHECK: memref.copy %[[casted]], %[[r]]
81
- // CHECK: memref.dealloc %[[alloc]]
82
78
83
79
// CHECK-NO-LAYOUT-LABEL: func @callee(
84
80
// CHECK-NO-LAYOUT-SAME: %{{.*}}: index,
@@ -90,9 +86,7 @@ func.func @main(%t: tensor<5xf32>) -> (f32, f32) {
90
86
// value and function signature.
91
87
// CHECK-NO-LAYOUT: %[[alloc2:.*]] = memref.alloc() : memref<2x5xf32>
92
88
// CHECK-NO-LAYOUT: memref.copy %[[subview]], %[[alloc2]]
93
- // CHECK-NO-LAYOUT: memref.dealloc %[[alloc]]
94
89
// CHECK-NO-LAYOUT: memref.copy %[[alloc2]], %[[r]]
95
- // CHECK-NO-LAYOUT: memref.dealloc %[[alloc2]]
96
90
97
91
// CHECK-BASELINE-LABEL: func @callee(
98
92
// CHECK-BASELINE-SAME: %{{.*}}: index) -> memref<2x5xf32, strided<[20, 1], offset: ?>> {
@@ -110,13 +104,11 @@ func.func @callee(%idx: index) -> tensor<2x5xf32> {
110
104
// CHECK: %[[casted:.*]] = memref.cast %[[alloc]] : memref<2x5xf32> to memref<2x5xf32, strided<[?, ?], offset: ?>>
111
105
// CHECK: call @callee(%{{.*}}, %[[casted]])
112
106
// CHECK: memref.load %[[casted]]
113
- // CHECK: memref.dealloc %[[alloc]]
114
107
115
108
// CHECK-NO-LAYOUT: func @main(
116
109
// CHECK-NO-LAYOUT: %[[alloc:.*]] = memref.alloc() : memref<2x5xf32>
117
110
// CHECK-NO-LAYOUT: call @callee(%{{.*}}, %[[alloc]])
118
111
// CHECK-NO-LAYOUT: memref.load %[[alloc]]
119
- // CHECK-NO-LAYOUT: memref.dealloc
120
112
121
113
// CHECK-BASELINE: func @main(
122
114
// CHECK-BASELINE: %[[call:.*]] = call @callee
0 commit comments