Differential D115491 Diff 393462 mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
Changeset View
Changeset View
Standalone View
Standalone View
mlir/lib/Dialect/Linalg/ComprehensiveBufferize/ComprehensiveBufferize.cpp
Show First 20 Lines • Show All 510 Lines • ▼ Show 20 Lines | #ifndef NDEBUG | ||||
SmallVector<OpOperand *> opOperands = getAliasingOpOperand(opResult); | SmallVector<OpOperand *> opOperands = getAliasingOpOperand(opResult); | ||||
assert(llvm::find(opOperands, &opOperand) != opOperands.end() && | assert(llvm::find(opOperands, &opOperand) != opOperands.end() && | ||||
"operand and result do not match"); | "operand and result do not match"); | ||||
#endif // NDEBUG | #endif // NDEBUG | ||||
// Certain buffers are not writeable: | // Certain buffers are not writeable: | ||||
// 1. A function bbArg that is not inplaceable or | // 1. A function bbArg that is not inplaceable or | ||||
// 2. A constant op. | // 2. A constant op. | ||||
assert(!aliasesNonWritableBuffer(opResult, aliasInfo, state) && | |||||
"expected that opResult does not alias non-writable buffer"); | |||||
bool nonWritable = | bool nonWritable = | ||||
aliasesNonWritableBuffer(opOperand.get(), aliasInfo, state); | aliasesNonWritableBuffer(opOperand.get(), aliasInfo, state); | ||||
if (!nonWritable) | if (!nonWritable) | ||||
return false; | return false; | ||||
// This is a problem only if the buffer is written to via some alias. | // This is a problem only if the buffer is written to via some alias. | ||||
bool hasWrite = aliasesInPlaceWrite(opResult, aliasInfo) || | bool hasWrite = aliasesInPlaceWrite(opResult, aliasInfo) || | ||||
aliasesInPlaceWrite(opOperand.get(), aliasInfo) || | aliasesInPlaceWrite(opOperand.get(), aliasInfo) || | ||||
▲ Show 20 Lines • Show All 245 Lines • Show Last 20 Lines |