Files
clang-p2996/llvm/lib/MC/MCPseudoProbe.cpp
Amir Ayupov 7ec682b16b [MC] Use StringRefs from pseudo_probe_desc section if it's mapped
Add `IsMMapped` flag to `buildGUID2FuncDescMap` controlling whether to
allocate a string in `FuncNameAllocator` or use StringRef directly.
Keep it false by default, only set it for BOLT use case because BOLT
keeps file sections in memory while processing them. llvm-profgen
constructs GUID2FuncDescMap and then releases the binary.

For medium sized binary with 0.8 GiB .pseudo_probe_desc section, this
saves 0.7 GiB peak RSS in perf2bolt.

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

Reviewers: maksfb, dcci, wlei-llvm, rafaelauler, ayermolo

Reviewed By: wlei-llvm

Pull Request: https://github.com/llvm/llvm-project/pull/112996
2024-11-08 16:39:33 -08:00

26 KiB