[NFC] Reserve memory to save reallocations. Noted in performance profiling

This commit is contained in:
Andrew Lenharth 2024-03-25 11:03:15 -05:00
parent 2b482b219d
commit 056d519468
1 changed files with 1 additions and 0 deletions

View File

@ -1210,6 +1210,7 @@ static SmallVector<Location> getAllPortLocs(ModTy module) {
SmallVector<Location> HWModuleOp::getAllPortLocs() {
SmallVector<Location> portLocs;
portLocs.reserve(getNumPorts());
auto resultLocs = getResultLocsAttr();
unsigned inputCount = 0;
auto modType = getModuleType();