This PR adds a SymbolCacheAnalysis to standardizing the caching of symbols for Circuits, Sequences and other function like operations which follow a call_<name> by callee, <name> @callee pattern.
This analysis is intended to provide a standard way to cache the callee operations by name and by call_operation as a way to mitigate the performance issues associated with lookupNearestSymbolFrom.
The analysis will cache callee of the request type. For example:
auto &cache =
getAnalysis<qssc::utils::SymbolCacheAnalysis>().addToCache<CircuitOp>();
Will cache all of the CircuitOps in the current passes operation.
Callee's ay be retrieved using:
cache.getOp<CircuitOp>(callCircuitOp);
Multiple operation types may be cached:
auto &cache =
getAnalysis<qssc::utils::SymbolCacheAnalysis>().addToCache<CircuitOp>().addToCache<SequenceOp>();
The analysis pass will by default retain the callee name to operation map from pass to pass based on the Operation type. The analysis may be forced to reset and re-cache by calling invalidate:
auto &cache =
getAnalysis<qssc::utils::SymbolCacheAnalysis>().invalidate().addToCache<CircuitOp>());
This PR adds a SymbolCacheAnalysis to standardizing the caching of symbols for Circuits, Sequences and other function like operations which follow a
call_<name>
bycallee
,<name> @callee
pattern.This analysis is intended to provide a standard way to cache the callee operations by name and by call_operation as a way to mitigate the performance issues associated with
lookupNearestSymbolFrom
.The analysis will cache callee of the request type. For example:
Will cache all of the
CircuitOp
s in the current passes operation.Callee's ay be retrieved using:
Multiple operation types may be cached:
The analysis pass will by default retain the callee name to operation map from pass to pass based on the Operation type. The analysis may be forced to reset and re-cache by calling
invalidate
: