/// Map tensor values to memref buffers.
void mapBuffer(ValueRange tensors, ValueRange buffers);
- /// Map a value to another value.
- void mapValue(Value from, Value to);
-
/// Map a tensor value to a memref buffer.
void mapBuffer(Value tensor, Value buffer);
/// Asserts if no buffer is associated.
Value lookupBuffer(Value tensor);
- /// Lookup the value that is associated to the given value. Asserts if no
- /// value is associated.
- Value lookupValue(Value value) const;
-
/// Return `true` if the given value is mapped.
bool isMapped(Value value) const;
/// `aliasInfo` keeps track of aliasing and equivalent values.
BufferizationAliasInfo aliasInfo;
- /// The mapping of tensors to buffers. May also contain mappings of non-tensor
- /// values.
+ /// The mapping of tensors to buffers.
BlockAndValueMapping mapping;
/// Obsolete ops that should be deleted after bufferization.
return mapping.map(tensor, buffer);
}
-void mlir::linalg::comprehensive_bufferize::BufferizationState::mapValue(
- Value from, Value to) {
- assert(from && "unexpected empty value");
- return mapping.map(from, to);
-}
-
/// Wrapper for better debugging.
Value mlir::linalg::comprehensive_bufferize::BufferizationState::lookupBuffer(
Value tensor) {
return buffer;
}
-Value mlir::linalg::comprehensive_bufferize::BufferizationState::lookupValue(
- Value value) const {
- Value v = mapping.lookupOrNull(value);
- if (!v) {
- llvm_unreachable("tensor is not mapped");
- return Value();
- }
- return v;
-}
-
bool mlir::linalg::comprehensive_bufferize::BufferizationState::isMapped(
Value value) const {
return mapping.contains(value);