As per the LLVM programmers manual, SmallPtrSets do linear scans on insertion and then turn into a hash-table if the set gets big. Here in the IDFCalculator, the SmallPtrSets have been configured to have 32 elements in each static allocation... which means that we linearly scan for all problems with up to 32 elements, which I feel is quite a large N. Shorten the SmallPtrSet size, and add a reserve method to avoid any repeated allocations, plus corresponding unit tests. Doing this yields a 0.13% compile-time improvement for debug-info builds, as we hit IDFCalculator pretty hard in InstrRefBasedLDV.
12 KiB
12 KiB