[clang] Introduce paged vector (PR #66430)

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 09:05:37 PDT 2023


nikic wrote:

> I also noticed that LoadedSLocEntryTable uses 42 elements tables, which probably introduces some extra divisions to do the indexing. I can try switching to 32 elements.

I've tested the following change that forces power of two pages sizes, but it did not have any impact: https://github.com/llvm/llvm-project/commit/fa54294b359c2934a34f3bf24a94b2172c5fc760

I've done some profiling and found that the regression seems to be related to inlining. In particular getAndAdvanceChar() inside LexTokenInternal() no longer gets inlined, and that's hot code. This only affects builds with GCC.

It's not totally obvious to me why that happens, as getAndAdvanceChar() doesn't appear to use PagedVector at all.

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


More information about the cfe-commits mailing list