[FIRRTL] Use cached circuit symbol table for option group lookup.

Now that we've added a cached symbol table at the circuit level, we
can use that to look up option groups as well. This didn't have a
major performance improvement on some large designs, but in the
presence of more instance choices, this could help. Regardless, this
is one minor piece to clean up for #6772.
This commit is contained in:
Mike Urbach 2024-03-26 09:20:03 -07:00
parent 8b9e87dc7f
commit c6325d287c
1 changed files with 1 additions and 4 deletions

View File

@ -3883,10 +3883,7 @@ ParseResult FIRStmtParser::parseInstanceChoice() {
SmallVector<PortInfo> modulePorts = defaultModule.getPorts();
// Find the option group.
auto circuit =
builder.getBlock()->getParentOp()->getParentOfType<CircuitOp>();
auto optionGroup =
dyn_cast_or_null<OptionOp>(circuit.lookupSymbol(optionGroupName));
auto optionGroup = circuitSymTbl.lookup<OptionOp>(optionGroupName);
if (!optionGroup)
return emitError(loc,
"use of undefined option group '" + optionGroupName + "'");