CIRCT
20.0.0git
|
Caching version of getFieldRefFromValue. More...
#include <FieldRefCache.h>
Public Member Functions | |
FieldRef | getFieldRefFromValue (Value value, bool lookThroughCasts=false) |
Caching version of getFieldRefFromValue. More... | |
void | clear () |
Drop all cached entries. More... | |
void | printStats (llvm::raw_ostream &os) const |
void | addToTotals (size_t &totalHits, size_t &totalComputed, size_t &totalQueries) const |
void | verifyImpl () const |
void | verify () const |
Verify cached fieldRefs against firrtl::getFieldRefFromValue. More... | |
Private Types | |
using | Key = llvm::PointerIntPair< Value, 1, bool > |
Private Attributes | |
DenseMap< Key, FieldRef > | refs |
size_t | computed = 0 |
size_t | hits = 0 |
size_t | queries = 0 |
Caching version of getFieldRefFromValue.
Computes the requested FieldRef and for all operations visited along the way. Tracks some stats in debug.
Definition at line 26 of file FieldRefCache.h.
|
private |
Definition at line 27 of file FieldRefCache.h.
void firrtl::FieldRefCache::addToTotals | ( | size_t & | totalHits, |
size_t & | totalComputed, | ||
size_t & | totalQueries | ||
) | const |
Definition at line 85 of file FieldRefCache.cpp.
|
inline |
FieldRef firrtl::FieldRefCache::getFieldRefFromValue | ( | Value | value, |
bool | lookThroughCasts = false |
||
) |
Caching version of getFieldRefFromValue.
Definition at line 23 of file FieldRefCache.cpp.
References assert(), and circt::firrtl::getDeltaRef().
void firrtl::FieldRefCache::printStats | ( | llvm::raw_ostream & | os | ) | const |
Definition at line 78 of file FieldRefCache.cpp.
|
inline |
Verify cached fieldRefs against firrtl::getFieldRefFromValue.
No-op in release builds.
Definition at line 51 of file FieldRefCache.h.
References verifyImpl().
void firrtl::FieldRefCache::verifyImpl | ( | ) | const |
Definition at line 93 of file FieldRefCache.cpp.
References assert(), and circt::firrtl::getFieldRefFromValue().
Referenced by verify().
|
private |
Definition at line 30 of file FieldRefCache.h.
|
private |
Definition at line 31 of file FieldRefCache.h.
|
private |
Definition at line 32 of file FieldRefCache.h.
Definition at line 28 of file FieldRefCache.h.
Referenced by clear().