MLIR  21.0.0git
Classes | Public Member Functions | Protected Attributes | List of all members
mlir::SymbolCache Class Reference

Default symbol cache implementation; stores associations between names (StringAttr's) to mlir::Operation's. More...

#include "mlir/Target/SMTLIB/SymCache.h"

+ Inheritance diagram for mlir::SymbolCache:

Public Member Functions

void addDefinition (mlir::Attribute key, mlir::Operation *op) override
 In the building phase, add symbols. More...
 
mlir::OperationgetDefinition (mlir::Attribute attr) const override
 Lookup a definition for 'symbol' in the cache. More...
 
SymbolCacheBase::Iterator begin () override
 
SymbolCacheBase::Iterator end () override
 
virtual mlir::OperationgetDefinition (mlir::Attribute symbol) const=0
 Lookup a definition for 'symbol' in the cache. More...
 
mlir::OperationgetDefinition (mlir::FlatSymbolRefAttr symbol) const
 Lookup a definition for 'symbol' in the cache. More...
 
- Public Member Functions inherited from mlir::SymbolCacheBase
virtual ~SymbolCacheBase ()
 
void addSymbol (mlir::SymbolOpInterface op)
 Adds the symbol-defining 'op' to the cache. More...
 
void addDefinitions (mlir::Operation *top)
 Populate the symbol cache with all symbol-defining operations within the 'top' operation. More...
 
mlir::OperationgetDefinition (mlir::FlatSymbolRefAttr symbol) const
 Lookup a definition for 'symbol' in the cache. More...
 

Protected Attributes

llvm::DenseMap< mlir::Attribute, mlir::Operation * > symbolCache
 This stores a lookup table from symbol attribute to the operation that defines it. More...
 

Additional Inherited Members

- Public Types inherited from mlir::SymbolCacheBase
using CacheItem = std::pair< mlir::Attribute, mlir::Operation * >
 Iterator support through a pointer to some abstract cache. More...
 

Detailed Description

Default symbol cache implementation; stores associations between names (StringAttr's) to mlir::Operation's.

Adding/getting definitions from the symbol cache is not thread safe. If this is required, synchronizing cache acccess should be ensured by the caller.

Definition at line 85 of file SymCache.h.

Member Function Documentation

◆ addDefinition()

void mlir::SymbolCache::addDefinition ( mlir::Attribute  key,
mlir::Operation op 
)
inlineoverridevirtual

In the building phase, add symbols.

Implements mlir::SymbolCacheBase.

Definition at line 88 of file SymCache.h.

References symbolCache.

◆ begin()

SymbolCacheBase::Iterator mlir::SymbolCache::begin ( )
inlineoverridevirtual

Implements mlir::SymbolCacheBase.

Definition at line 121 of file SymCache.h.

References symbolCache.

◆ end()

SymbolCacheBase::Iterator mlir::SymbolCache::end ( )
inlineoverridevirtual

Implements mlir::SymbolCacheBase.

Definition at line 125 of file SymCache.h.

References symbolCache.

◆ getDefinition() [1/3]

mlir::Operation* mlir::SymbolCache::getDefinition ( mlir::Attribute  symbol) const
inlineoverridevirtual

Lookup a definition for 'symbol' in the cache.

Implements mlir::SymbolCacheBase.

Definition at line 94 of file SymCache.h.

References symbolCache.

◆ getDefinition() [2/3]

virtual mlir::Operation* mlir::SymbolCacheBase::getDefinition

Lookup a definition for 'symbol' in the cache.

◆ getDefinition() [3/3]

mlir::Operation* mlir::SymbolCacheBase::getDefinition
inline

Lookup a definition for 'symbol' in the cache.

Definition at line 45 of file SymCache.h.

Member Data Documentation

◆ symbolCache

llvm::DenseMap<mlir::Attribute, mlir::Operation *> mlir::SymbolCache::symbolCache
protected

This stores a lookup table from symbol attribute to the operation that defines it.

Definition at line 104 of file SymCache.h.

Referenced by addDefinition(), begin(), end(), and getDefinition().


The documentation for this class was generated from the following file: