Skip to content

Commit 9bb5bd0

Browse files
committed
Fix rebase
1 parent 5b38210 commit 9bb5bd0

File tree

2 files changed

+0
-78
lines changed

2 files changed

+0
-78
lines changed

mlir/include/mlir/Dialect/Bufferization/Transforms/Passes.td

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -15,79 +15,6 @@ class BufferScopePass<string name>
1515
: PassBase<name, "::mlir::bufferization::BufferScopePassBase">;
1616

1717

18-
def BufferDeallocation : BufferScopePass<"buffer-deallocation"> {
19-
let summary = "Adds all required dealloc operations for all allocations in "
20-
"the input program";
21-
let description = [{
22-
This pass implements an algorithm to automatically introduce all required
23-
deallocation operations for all buffers in the input program. This ensures
24-
that the resulting program does not have any memory leaks.
25-
26-
27-
Input
28-
29-
```mlir
30-
#map0 = affine_map<(d0) -> (d0)>
31-
module {
32-
func.func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
33-
cf.cond_br %arg0, ^bb1, ^bb2
34-
^bb1:
35-
cf.br ^bb3(%arg1 : memref<2xf32>)
36-
^bb2:
37-
%0 = memref.alloc() : memref<2xf32>
38-
linalg.generic {
39-
indexing_maps = [#map0, #map0],
40-
iterator_types = ["parallel"]} %arg1, %0 {
41-
^bb0(%gen1_arg0: f32, %gen1_arg1: f32):
42-
%tmp1 = exp %gen1_arg0 : f32
43-
linalg.yield %tmp1 : f32
44-
}: memref<2xf32>, memref<2xf32>
45-
cf.br ^bb3(%0 : memref<2xf32>)
46-
^bb3(%1: memref<2xf32>):
47-
"memref.copy"(%1, %arg2) : (memref<2xf32>, memref<2xf32>) -> ()
48-
return
49-
}
50-
}
51-
52-
```
53-
54-
Output
55-
56-
```mlir
57-
#map0 = affine_map<(d0) -> (d0)>
58-
module {
59-
func.func @condBranch(%arg0: i1, %arg1: memref<2xf32>, %arg2: memref<2xf32>) {
60-
cf.cond_br %arg0, ^bb1, ^bb2
61-
^bb1: // pred: ^bb0
62-
%0 = memref.alloc() : memref<2xf32>
63-
memref.copy(%arg1, %0) : memref<2xf32>, memref<2xf32>
64-
cf.br ^bb3(%0 : memref<2xf32>)
65-
^bb2: // pred: ^bb0
66-
%1 = memref.alloc() : memref<2xf32>
67-
linalg.generic {
68-
indexing_maps = [#map0, #map0],
69-
iterator_types = ["parallel"]} %arg1, %1 {
70-
^bb0(%arg3: f32, %arg4: f32):
71-
%4 = exp %arg3 : f32
72-
linalg.yield %4 : f32
73-
}: memref<2xf32>, memref<2xf32>
74-
%2 = memref.alloc() : memref<2xf32>
75-
memref.copy(%1, %2) : memref<2xf32>, memref<2xf32>
76-
dealloc %1 : memref<2xf32>
77-
cf.br ^bb3(%2 : memref<2xf32>)
78-
^bb3(%3: memref<2xf32>): // 2 preds: ^bb1, ^bb2
79-
memref.copy(%3, %arg2) : memref<2xf32>, memref<2xf32>
80-
dealloc %3 : memref<2xf32>
81-
return
82-
}
83-
84-
}
85-
```
86-
87-
}];
88-
let constructor = "mlir::bufferization::createBufferDeallocationPass()";
89-
}
90-
9118
def OwnershipBasedBufferDeallocation : BufferScopePass<
9219
"ownership-based-buffer-deallocation"> {
9320
let summary = "Adds all required dealloc operations for all allocations in "

mlir/lib/Dialect/Affine/Transforms/AffineDataCopyGeneration.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@ struct AffineDataCopyGeneration
8787

8888
/// Generates copies for memref's living in 'slowMemorySpace' into newly created
8989
/// buffers in 'fastMemorySpace', and replaces memory operations to the former
90-
<<<<<<< HEAD
91-
/// by the latter.
92-
std::unique_ptr<OperationPass<func::FuncOp>>
93-
=======
9490
/// by the latter. Only load op's handled for now.
9591
std::unique_ptr<AffineScopePassBase>
96-
>>>>>>> 9bd74f961815 (Make affine and bufferization pass applicable to any AffineScopeOp/AutomaticAllocationScope)
9792
mlir::affine::createAffineDataCopyGenerationPass(
9893
unsigned slowMemorySpace, unsigned fastMemorySpace, unsigned tagMemorySpace,
9994
int minDmaTransferSize, uint64_t fastMemCapacityBytes) {

0 commit comments

Comments
 (0)