[PATCH] D109036: [CSSPGO] Sort function offset table to speed up profile loading.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 17:17:52 PDT 2021


hoy created this revision.
Herald added subscribers: modimo, wenlei, hiraditya.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

With the context split work, the context-based (an array of strings) sorting performed at profile load time is way more expansive than single-string-based sorting. This is likely due to auxiliary operations done on each array element, such as indirect references, std::min operations, also likely cache misses. In this change I'm presorting profiles during profile generation time to avoid sorting at compile time.

This effectively cut down compile time by 20% for one of our large services.

Test Plan:


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109036

Files:
  llvm/include/llvm/ProfileData/SampleProf.h
  llvm/include/llvm/ProfileData/SampleProfReader.h
  llvm/lib/ProfileData/SampleProfReader.cpp
  llvm/lib/ProfileData/SampleProfWriter.cpp
  llvm/test/Transforms/SampleProfile/csspgo-import-list.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109036.369822.patch
Type: text/x-patch
Size: 11911 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210901/fd09cea5/attachment.bin>


More information about the llvm-commits mailing list