[llvm] [Support] Use bump ptr allocator for domtree nodes (PR #102516)

Alexis Engelke via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 17 22:44:28 PST 2026


aengelke wrote:

I investigated the ThinLTO max-rss regression. ModuleSummaryIndexAnalysis keeps all DomTrees in memory at the same time, were the small waste of every DomTree adds up. I changed the BumpPtrAllocator configuration to be less wasteful for small functions (many functions have less than 70 blocks, so start with 8 in the first slab). With this change, the [max-rss regression is largely gone](https://llvm-compile-time-tracker.com/compare.php?from=1c4e03aa2619339248c77b0f0ebd564e766415ef&to=5fb062451a8adbda9e2c1ee4f49a92f43d86c4d8&stat=max-rss). (Well, locally, in some ThinLTO cases there's still a regression, but it's much smaller and should, IMO, be worth the performance gains.)

Recycling nodes isn't beneficial, eraseNode is called only rarely and most of the time after several erases the tree is recomputed completely.

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


More information about the llvm-commits mailing list