[PATCH] D159460: [BOLT][NFC] Speedup YAML profile processing

Amir Ayupov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 18:54:38 PDT 2023


Amir created this revision.
Amir added a reviewer: bolt.
Herald added a reviewer: rafauler.
Herald added subscribers: treapster, ayermolo.
Herald added a reviewer: maksfb.
Herald added a project: All.
Amir requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

Reduce YAML profile processing times:

- preprocessProfile: speed up buildNameMaps by replacing ProfileNameToProfile mapping with ProfileFunctionNames set and ProfileBFs vector. Pre-look up YamlBF->BF correspondence, memoize in ProfileBFs.
- readProfile: replace iteration over all functions in the binary by iteration over profile functions (strict match and LTO name match).

On a large binary (1.9M functions) and large YAML profile (121MB, 30k functions)
reduces profile steps runtime:
pre-process profile data: 12.4953s -> 10.7123s
process profile data: 9.8195s -> 5.6639s

Compared to fdata profile reading:
pre-process profile data: 8.0268s
process profile data: 1.0265s
process profile data pre-CFG: 0.1644s


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159460

Files:
  bolt/include/bolt/Profile/YAMLProfileReader.h
  bolt/lib/Profile/YAMLProfileReader.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159460.555960.patch
Type: text/x-patch
Size: 9567 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230906/af6081ad/attachment.bin>


More information about the llvm-commits mailing list