Rename const pool cache rebuild (#7845)

This commit is contained in:
Nick Brereton 2026-06-26 17:27:30 -04:00
parent 3b97c7fd4d
commit 88147b01cf
5 changed files with 5 additions and 5 deletions

View File

@ -1000,8 +1000,8 @@ public:
// this matters, the caller must handle the dtype difference as appropriate. If 'mergeDType' is
// false, the returned VarScope will have _->dtypep()->sameTree(initp->dtypep()) return true.
AstVarScope* findConst(AstConst* initp, bool mergeDType);
// Rebuild hashes after potential removals
void reCache();
// Rebuild hashes and missing variable scopes after potential removals
void rebuildVarScopesAndCache();
};
class AstConstraint final : public AstNode {
// Constraint

View File

@ -1780,7 +1780,7 @@ AstVarScope* AstConstPool::findConst(AstConst* initp, bool mergeDType) {
return varScopep;
}
void AstConstPool::reCache() {
void AstConstPool::rebuildVarScopesAndCache() {
m_tables.clear();
m_consts.clear();
std::unordered_map<const AstVar*, AstVarScope*> varScopeps;

View File

@ -597,7 +597,7 @@ public:
// We may have removed some datatypes, cleanup
nodep->typeTablep()->repairCache();
VIsCached::clearCacheTree(); // Removing assignments may affect isPure
nodep->constPoolp()->reCache();
nodep->constPoolp()->rebuildVarScopesAndCache();
}
~DeadVisitor() override {
V3Stats::addStatSum("Optimizations, deadified FTasks", m_statFTasksDeadified);

View File

@ -18,7 +18,7 @@ module t;
assign idx = cyc[3:0];
// V3Case lowers this to a 512-bit constant-pool lookup table before V3Dead
// calls AstConstPool::reCache().
// calls AstConstPool::rebuildVarScopesAndCache().
logic [31:0] case_word;
always_comb
case (idx)