CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
circt::reduce::InnerSymbolUses Struct Reference

A helper struct that scans a root operation and all its nested operations for InnerRefAttrs. More...

#include <ReductionUtils.h>

Collaboration diagram for circt::reduce::InnerSymbolUses:
Collaboration graph
[legend]

Public Member Functions

 InnerSymbolUses (Operation *root)
 
 InnerSymbolUses ()=default
 
 InnerSymbolUses (const InnerSymbolUses &)=default
 
 InnerSymbolUses (InnerSymbolUses &&)=default
 
InnerSymbolUsesoperator= (const InnerSymbolUses &)=default
 
InnerSymbolUsesoperator= (InnerSymbolUses &&)=default
 
bool hasInnerRef (Operation *op) const
 Check whether an op is targeted by an inner ref.
 
bool hasInnerRef (hw::InnerRefAttr innerRef) const
 Check if the given inner ref is used.
 
bool hasInnerRef (StringAttr symbol) const
 Check if the given symbol name is targeted by an inner ref.
 
bool hasInnerRef (StringAttr symbol, StringAttr innerSym) const
 Check if the given symbol and inner symbol name pair is targeted by an inner ref.
 
bool hasSymbolRef (Operation *op) const
 Check whether the given symbol is targeted by a symbol ref.
 
bool hasSymbolRef (StringAttr symbol) const
 Check whether the given symbol name is targeted by a symbol ref.
 
bool hasRef (Operation *op) const
 Check whether the given symbol is targeted by a symbol ref or inner ref.
 
bool hasRef (StringAttr symbol) const
 Check whether the given symbol name is targeted by a symbol ref or inner ref.
 

Private Attributes

DenseSet< std::pair< StringAttr, StringAttr > > innerRefs
 Symbol and inner symbol name pairs used in inner refs.
 
DenseSet< StringAttr > innerRefModules
 Symbol names used in inner refs.
 
DenseSet< StringAttr > symbolRefs
 Symbol names used in symbol or inner refs.
 

Detailed Description

A helper struct that scans a root operation and all its nested operations for InnerRefAttrs.

Definition at line 27 of file ReductionUtils.h.

Constructor & Destructor Documentation

◆ InnerSymbolUses() [1/4]

InnerSymbolUses::InnerSymbolUses ( Operation *  root)

Definition at line 43 of file ReductionUtils.cpp.

References innerRefModules, innerRefs, and symbolRefs.

◆ InnerSymbolUses() [2/4]

circt::reduce::InnerSymbolUses::InnerSymbolUses ( )
default

◆ InnerSymbolUses() [3/4]

circt::reduce::InnerSymbolUses::InnerSymbolUses ( const InnerSymbolUses )
default

◆ InnerSymbolUses() [4/4]

circt::reduce::InnerSymbolUses::InnerSymbolUses ( InnerSymbolUses &&  )
default

Member Function Documentation

◆ hasInnerRef() [1/4]

bool InnerSymbolUses::hasInnerRef ( hw::InnerRefAttr  innerRef) const

Check if the given inner ref is used.

Definition at line 81 of file ReductionUtils.cpp.

References innerRefs.

◆ hasInnerRef() [2/4]

bool InnerSymbolUses::hasInnerRef ( Operation *  op) const

Check whether an op is targeted by an inner ref.

Considers both the sym_name and the inner_sym attributes on the given op.

Definition at line 65 of file ReductionUtils.cpp.

References circt::hw::InnerSymbolTable::getInnerSymbol(), getSymbolName(), and hasInnerRef().

Referenced by hasInnerRef(), hasRef(), and hasRef().

◆ hasInnerRef() [3/4]

bool InnerSymbolUses::hasInnerRef ( StringAttr  symbol) const

Check if the given symbol name is targeted by an inner ref.

Definition at line 85 of file ReductionUtils.cpp.

References innerRefModules.

◆ hasInnerRef() [4/4]

bool InnerSymbolUses::hasInnerRef ( StringAttr  symbol,
StringAttr  innerSym 
) const

Check if the given symbol and inner symbol name pair is targeted by an inner ref.

Definition at line 89 of file ReductionUtils.cpp.

References innerRefs.

◆ hasRef() [1/2]

bool InnerSymbolUses::hasRef ( Operation *  op) const

Check whether the given symbol is targeted by a symbol ref or inner ref.

Definition at line 102 of file ReductionUtils.cpp.

References hasInnerRef(), and hasSymbolRef().

◆ hasRef() [2/2]

bool InnerSymbolUses::hasRef ( StringAttr  symbol) const

Check whether the given symbol name is targeted by a symbol ref or inner ref.

Definition at line 106 of file ReductionUtils.cpp.

References hasInnerRef(), and hasSymbolRef().

◆ hasSymbolRef() [1/2]

bool InnerSymbolUses::hasSymbolRef ( Operation *  op) const

Check whether the given symbol is targeted by a symbol ref.

Definition at line 94 of file ReductionUtils.cpp.

References getSymbolName(), and symbolRefs.

Referenced by hasRef(), and hasRef().

◆ hasSymbolRef() [2/2]

bool InnerSymbolUses::hasSymbolRef ( StringAttr  symbol) const

Check whether the given symbol name is targeted by a symbol ref.

Definition at line 98 of file ReductionUtils.cpp.

References symbolRefs.

◆ operator=() [1/2]

InnerSymbolUses & circt::reduce::InnerSymbolUses::operator= ( const InnerSymbolUses )
default

◆ operator=() [2/2]

InnerSymbolUses & circt::reduce::InnerSymbolUses::operator= ( InnerSymbolUses &&  )
default

Member Data Documentation

◆ innerRefModules

DenseSet<StringAttr> circt::reduce::InnerSymbolUses::innerRefModules
private

Symbol names used in inner refs.

Definition at line 63 of file ReductionUtils.h.

Referenced by hasInnerRef(), and InnerSymbolUses().

◆ innerRefs

DenseSet<std::pair<StringAttr, StringAttr> > circt::reduce::InnerSymbolUses::innerRefs
private

Symbol and inner symbol name pairs used in inner refs.

Definition at line 61 of file ReductionUtils.h.

Referenced by hasInnerRef(), hasInnerRef(), and InnerSymbolUses().

◆ symbolRefs

DenseSet<StringAttr> circt::reduce::InnerSymbolUses::symbolRefs
private

Symbol names used in symbol or inner refs.

Definition at line 65 of file ReductionUtils.h.

Referenced by hasSymbolRef(), hasSymbolRef(), and InnerSymbolUses().


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