Skip to content

Commit 2a457a4

Browse files
committed
--buffer-deallocation is removed.
The upstream suggestion is to use -buffer-deallocation-pipeline llvm/llvm-project#126366 https://discourse.llvm.org/t/psa-bufferization-new-buffer-deallocation-pipeline/73375 However, this breaks more or less everything for us, since the --ownership-based-buffer-deallocation pass blanket-ly fails for ops with unknown memory effects https://github.com/llvm/llvm-project/blob/da4958ae2b384c2a027cf20c67b7e211d39fcbfe/mlir/lib/Dialect/Bufferization/Transforms/OwnershipBasedBufferDeallocation.cpp#L523 Maybe we leave this as TODO...
1 parent 02ea1f0 commit 2a457a4

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

frontend/catalyst/pipelines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def get_bufferization_stage(options: CompileOptions) -> List[str]:
240240
"func.func(buffer-hoisting)",
241241
"func.func(buffer-loop-hoisting)",
242242
"func.func(promote-buffers-to-stack)",
243-
"ownership-based-buffer-deallocation",
243+
# "buffer-deallocation-pipeline",
244244
"convert-arraylist-to-memref",
245245
"convert-bufferization-to-memref",
246246
"canonicalize", # Must be after convert-bufferization-to-memref

mlir/lib/Catalyst/Transforms/BufferizableOpInterfaceImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct PrintOpInterface
7575
struct CustomCallOpInterface
7676
: public bufferization::BufferizableOpInterface::ExternalModel<CustomCallOpInterface,
7777
CustomCallOp> {
78-
bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
78+
// bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
7979

8080
bool bufferizesToMemoryRead(Operation *op, OpOperand &opOperand,
8181
const bufferization::AnalysisState &state) const
@@ -251,7 +251,7 @@ void convertTypes(SmallVector<Type> inTypes, SmallVector<Type> &convertedResults
251251
struct CallbackCallOpInterface
252252
: public bufferization::BufferizableOpInterface::ExternalModel<CallbackCallOpInterface,
253253
CallbackCallOp> {
254-
bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
254+
// bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
255255

256256
bool bufferizesToMemoryRead(Operation *op, OpOperand &opOperand,
257257
const bufferization::AnalysisState &state) const

mlir/lib/Driver/Pipelines.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ void createBufferizationPipeline(OpPassManager &pm)
8686
pm.addNestedPass<mlir::func::FuncOp>(mlir::bufferization::createBufferHoistingPass());
8787
pm.addNestedPass<mlir::func::FuncOp>(mlir::bufferization::createBufferLoopHoistingPass());
8888
pm.addNestedPass<mlir::func::FuncOp>(mlir::bufferization::createPromoteBuffersToStackPass());
89-
pm.addPass(mlir::bufferization::createOwnershipBasedBufferDeallocationPass());
89+
// pm.addPass(mlir::bufferization::createOwnershipBasedBufferDeallocationPass());
9090
pm.addPass(catalyst::createArrayListToMemRefPass());
9191
pm.addPass(mlir::createConvertBufferizationToMemRefPass());
9292
pm.addPass(mlir::createCanonicalizerPass());

mlir/lib/Quantum/Transforms/BufferizableOpInterfaceImpl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ struct SampleOpInterface
177177
return false;
178178
}
179179

180-
bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
180+
// bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
181181

182182
bufferization::AliasingValueList
183183
getAliasingValues(Operation *op, OpOperand &opOperand,
@@ -227,7 +227,7 @@ struct CountsOpInterface
227227
return false;
228228
}
229229

230-
bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
230+
// bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
231231

232232
bufferization::AliasingValueList
233233
getAliasingValues(Operation *op, OpOperand &opOperand,
@@ -287,7 +287,7 @@ struct ProbsOpInterface
287287
return false;
288288
}
289289

290-
bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
290+
// bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
291291

292292
bufferization::AliasingValueList
293293
getAliasingValues(Operation *op, OpOperand &opOperand,
@@ -340,7 +340,7 @@ struct StateOpInterface
340340
return false;
341341
}
342342

343-
bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
343+
// bool bufferizesToAllocation(Operation *op, Value value) const { return true; }
344344

345345
bufferization::AliasingValueList
346346
getAliasingValues(Operation *op, OpOperand &opOperand,

0 commit comments

Comments
 (0)