[llvm-branch-commits] [MC] Use StringRefs from pseudo_probe_desc section if it's mapped (PR #112996)

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Oct 18 16:09:35 PDT 2024


https://github.com/aaupov created https://github.com/llvm/llvm-project/pull/112996

Add `IsMMapped` flag to `buildGUID2FuncDescMap` controlling whether to
allocate a string in `FuncNameAllocator` or use StringRef directly.

This saves ~0.7 GiB peak RSS in perf2bolt processing a medium sized
binary with ~0.8 GiB .pseudo_probe_desc section.

This is because BOLT keeps file sections in memory while processing them
whereas llvm-profgen constructs GUID2FuncDescMap and then releases the
binary.

Test Plan: no-op for llvm-profgen, NFC for perf2bolt





More information about the llvm-branch-commits mailing list