[llvm] [SROA] Use SmallPtrSet for PromotableAllocas (PR #105809)

Bartłomiej Chmiel via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 27 01:59:07 PDT 2024


b-chmiel wrote:

@nikic I'd tested several possibilities (including `std::deque`, `SmallSetVector` and derivatives) and `SetVector<AllocaInst *, SmallVector<AllocaInst *>, SmallPtrSet<AllocaInst *, 16>, 16>` brought the best results while still being a stable container.


Microbenchmarks (100 runs):
```
Program                                       compile_time
                                              base         improved diff
consumer-typeset/consumer-typeset               4.17         4.19    0.6%
lencod/lencod                                   4.20         4.22    0.4%
7zip/7zip-benchmark                            68.23        68.37    0.2%
sqlite3/sqlite3                                 1.17         1.17   -0.0%
kimwitu++/kc                                   10.87        10.83   -0.3%
ClamAV/clamscan                                 5.26         5.24   -0.3%
Bullet/bullet                                  26.45        26.33   -0.5%
SPASS/SPASS                                     5.69         5.64   -0.8%
mafft/pairlocalalign                            2.26         2.23   -1.2%
tramp3d-v4/tramp3d-v4                           6.29         6.20   -1.5%
                           Geomean difference                       -0.3%
      compile_time
l/r           base   improved       diff
count  10.000000    10.000000  10.000000
mean   13.458060    13.441530 -0.003470
std    20.556258    20.595136  0.006564
min    1.168200     1.168000  -0.014726
25%    4.175600     4.196700  -0.006884
50%    5.474550     5.443800  -0.003395
75%    9.721975     9.671825   0.001486
max    68.229400    68.368500  0.005544
```

https://github.com/llvm/llvm-project/pull/105809


More information about the llvm-commits mailing list