14 #ifndef MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_BUFFERUTILS_H
15 #define MLIR_DIALECT_BUFFERIZATION_TRANSFORMS_BUFFERUTILS_H
31 namespace bufferization {
53 AllocEntryList::const_iterator
begin()
const {
return allocs.begin(); }
56 AllocEntryList::const_iterator
end()
const {
return allocs.end(); }
59 AllocEntryList::iterator
begin() {
return allocs.begin(); }
62 AllocEntryList::iterator
end() {
return allocs.end(); }
80 template <
typename DominatorT>
83 const DominatorT &doms) {
89 for (
Value childValue : values) {
93 blocks.insert(user->getBlock());
96 blocks.insert(childValue.getParentBlock());
98 return doms.findNearestCommonDominator(blocks);
124 FailureOr<memref::GlobalOp>
getGlobalFor(arith::ConstantOp constantOp,
Attributes are known-constant values of operations.
Block represents an ordered list of Operations.
A straight-forward alias analysis which ensures that all dependencies of all values will be determine...
SmallPtrSet< Value, 16 > ValueSetT
Represents an analysis for computing liveness information from a given top-level operation.
Operation is the basic unit of execution within MLIR.
user_range getUsers()
Returns a range of all users.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Block * getParentBlock()
Return the Block in which this Value is defined.
A simple analysis that detects allocation operations.
void registerAlloc(const AllocEntry &entry)
Registers a new allocation entry.
static Operation * getStartOperation(Value allocValue, Block *placementBlock, const Liveness &liveness)
Get the start operation to place the given alloc value within the specified placement block.
BufferPlacementAllocs(Operation *op)
Initializes the internal list by discovering all supported allocation nodes.
AllocEntryList::iterator end()
Returns the end iterator that can be used in combination with begin.
AllocEntryList::const_iterator end() const
Returns the end iterator that can be used in combination with begin.
AllocEntryList::iterator begin()
Returns the begin iterator to iterate over all allocations.
std::tuple< Value, Operation * > AllocEntry
Represents a tuple of allocValue and deallocOperation.
AllocEntryList::const_iterator begin() const
Returns the begin iterator to iterate over all allocations.
SmallVector< AllocEntry, 8 > AllocEntryList
Represents a list containing all alloc entries.
Block * findCommonDominator(Value value, const BufferViewFlowAnalysis::ValueSetT &values, const DominatorT &doms)
Finds a common dominator for the given value while taking the positions of the values in the value se...
FailureOr< memref::GlobalOp > getGlobalFor(arith::ConstantOp constantOp, uint64_t alignment, Attribute memorySpace={})
Include the generated interface declarations.