Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
StructuralHasher Struct Reference
Collaboration diagram for StructuralHasher:
Collaboration graph
[legend]

Public Member Functions

 StructuralHasher (const StructuralHasherSharedConstants &constants)
 
ModuleInfo getModuleInfo (FModuleLike module)
 

Private Member Functions

void populateInnerSymIDTable (FModuleLike module)
 Find all the ports and operations which may define an inner symbol operations and give each a unique id.
 
unsigned getID (void *object)
 
unsigned finalizeID (void *object)
 
std::pair< size_t, size_t > getInnerSymID (StringAttr name)
 
void update (OpOperand &operand)
 
void update (const void *pointer)
 
void update (size_t value)
 
template<typename T , typename U >
void update (const std::pair< T, U > &pair)
 
void update (TypeID typeID)
 
void update (BundleType type)
 
void update (Type type)
 
void update (OpResult result)
 
void update (Operation *op, DictionaryAttr dict)
 Hash the top level attribute dictionary of the operation.
 
void update (mlir::OperationName name)
 
void update (Block *block)
 
void update (Region *region)
 
void update (Operation *op)
 

Private Attributes

DenseMap< void *, unsigned > idTable
 
unsigned nextID = 0
 
DenseMap< StringAttr, std::pair< size_t, size_t > > innerSymIDTable
 
std::vector< StringAttr > referredModuleNames
 
const StructuralHasherSharedConstantsconstants
 
llvm::SHA256 sha
 
size_t position = 0
 

Detailed Description

Definition at line 138 of file Dedup.cpp.

Constructor & Destructor Documentation

◆ StructuralHasher()

StructuralHasher::StructuralHasher ( const StructuralHasherSharedConstants constants)
inlineexplicit

Definition at line 139 of file Dedup.cpp.

Member Function Documentation

◆ finalizeID()

unsigned StructuralHasher::finalizeID ( void *  object)
inlineprivate

Definition at line 181 of file Dedup.cpp.

◆ getID()

unsigned StructuralHasher::getID ( void *  object)
inlineprivate

Definition at line 173 of file Dedup.cpp.

◆ getInnerSymID()

std::pair< size_t, size_t > StructuralHasher::getInnerSymID ( StringAttr  name)
inlineprivate

Definition at line 190 of file Dedup.cpp.

◆ getModuleInfo()

ModuleInfo StructuralHasher::getModuleInfo ( FModuleLike  module)
inline

Definition at line 142 of file Dedup.cpp.

References populateInnerSymIDTable(), referredModuleNames, sha, and update().

◆ populateInnerSymIDTable()

void StructuralHasher::populateInnerSymIDTable ( FModuleLike  module)
inlineprivate

Find all the ports and operations which may define an inner symbol operations and give each a unique id.

If the port/operation does define an inner symbol, map the symbol name to a pair of the id and the symbol's field id. When we hash (local) references to this inner symbol, we will hash in the id and the the field id.

Definition at line 154 of file Dedup.cpp.

References innerSymIDTable.

Referenced by getModuleInfo().

◆ update() [1/13]

void StructuralHasher::update ( Block *  block)
inlineprivate

Definition at line 314 of file Dedup.cpp.

◆ update() [2/13]

void StructuralHasher::update ( BundleType  type)
inlineprivate

Definition at line 230 of file Dedup.cpp.

◆ update() [3/13]

template<typename T , typename U >
void StructuralHasher::update ( const std::pair< T, U > &  pair)
inlineprivate

Definition at line 222 of file Dedup.cpp.

◆ update() [4/13]

void StructuralHasher::update ( const void *  pointer)
inlineprivate

Definition at line 211 of file Dedup.cpp.

References circt::firrtl::addr.

◆ update() [5/13]

void StructuralHasher::update ( mlir::OperationName  name)
inlineprivate

Definition at line 308 of file Dedup.cpp.

◆ update() [6/13]

void StructuralHasher::update ( Operation *  op)
inlineprivate

Definition at line 333 of file Dedup.cpp.

◆ update() [7/13]

void StructuralHasher::update ( Operation *  op,
DictionaryAttr  dict 
)
inlineprivate

Hash the top level attribute dictionary of the operation.

This function has special handling for inner symbols, ports, and referenced modules.

Definition at line 259 of file Dedup.cpp.

◆ update() [8/13]

void StructuralHasher::update ( OpOperand &  operand)
inlineprivate

Definition at line 194 of file Dedup.cpp.

Referenced by getModuleInfo().

◆ update() [9/13]

void StructuralHasher::update ( OpResult  result)
inlineprivate

Definition at line 245 of file Dedup.cpp.

◆ update() [10/13]

void StructuralHasher::update ( Region *  region)
inlineprivate

Definition at line 325 of file Dedup.cpp.

◆ update() [11/13]

void StructuralHasher::update ( size_t  value)
inlineprivate

Definition at line 216 of file Dedup.cpp.

References circt::firrtl::addr.

◆ update() [12/13]

void StructuralHasher::update ( Type  type)
inlineprivate

Definition at line 239 of file Dedup.cpp.

◆ update() [13/13]

void StructuralHasher::update ( TypeID  typeID)
inlineprivate

Definition at line 227 of file Dedup.cpp.

References update().

Referenced by update().

Member Data Documentation

◆ constants

const StructuralHasherSharedConstants& StructuralHasher::constants
private

Definition at line 371 of file Dedup.cpp.

◆ idTable

DenseMap<void *, unsigned> StructuralHasher::idTable
private

Definition at line 361 of file Dedup.cpp.

◆ innerSymIDTable

DenseMap<StringAttr, std::pair<size_t, size_t> > StructuralHasher::innerSymIDTable
private

Definition at line 365 of file Dedup.cpp.

Referenced by populateInnerSymIDTable().

◆ nextID

unsigned StructuralHasher::nextID = 0
private

Definition at line 362 of file Dedup.cpp.

◆ position

size_t StructuralHasher::position = 0
private

Definition at line 378 of file Dedup.cpp.

◆ referredModuleNames

std::vector<StringAttr> StructuralHasher::referredModuleNames
private

Definition at line 368 of file Dedup.cpp.

Referenced by getModuleInfo().

◆ sha

llvm::SHA256 StructuralHasher::sha
private

Definition at line 375 of file Dedup.cpp.

Referenced by getModuleInfo().


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