[Chapel Merge] Reduce vector allocations in compiler (pt 1)

Branch: refs/heads/main
Revision: e18b43c
Author: aconsroe-hpe
Log Message:

Merge pull request #18518 from aconsroe-hpe/reduce-vector-allocations-1

Reduce vector allocations in compiler (pt 1)

reviewed by @mppf

These changes reduce allocations compiling hello world from 9717441 to 8231998 (15%) reduction and a 2% time improvement compiling arkouda.

I'm not in love with the class static but it is in line with the existing code. buildBasicBlocks is called 289502 times in compiling hello world and this saves us from having a caller pass it in and lets the size naturally fit (max size 576 w/ 99% of 7) to the workload. The max size does not present a high memory overhead if reset is not called (which it isn't currently).

The second change in computeAlignment does a one-time resize instead of repeated push_back as this will reallocate every time the size is grown.

Passed paratest

Modified Files:
M compiler/AST/bb.cpp

M compiler/include/bb.h
M compiler/resolution/ResolutionCandidate.cpp

Compare: https://github.com/chapel-lang/chapel/compare/1f3cc26bf507...e18b43c30b0b