Skip to content

Commit 2c5c5ca

Browse files
[mlir][linalg][bufferize] Fix CallOp bufferization
Previously, CallOps did not have any aliasing OpResult/OpOperand pairs. Therefore, CallOps were mostly ignored by the analysis and buffer copies were not inserted when necessary. This commit introduces the following changes: * Function bbArgs writable by default. A function can now be bufferized without inspecting its callers. * Callers must introduce buffer copies of function arguments when necessary. If a function is external, the caller must conservatively assume that a function argument is modified by the callee after bufferization. If the function is not external, the caller inspects the callee to determine if a function argument is modified. Differential Revision: https://reviews.llvm.org/D116457
1 parent 3d5179f commit 2c5c5ca

File tree

4 files changed

+281
-131
lines changed

4 files changed

+281
-131
lines changed

mlir/lib/Dialect/Linalg/ComprehensiveBufferize/BufferizableOpInterface.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ bool mlir::linalg::comprehensive_bufferize::BufferizationState::
256256
/// themselves (e.g., ExtractSliceOp).
257257
bool mlir::linalg::comprehensive_bufferize::BufferizationState::isValueRead(
258258
Value value) const {
259+
assert(value.getType().isa<TensorType>() && "expected TensorType");
259260
SmallVector<OpOperand *> workingSet;
260261
for (OpOperand &use : value.getUses())
261262
workingSet.push_back(&use);

0 commit comments

Comments
 (0)