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

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 31 18:06:08 PDT 2021


wenlei added a comment.

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

Does this gets us back to where we were? or is there still small regression?



================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:732
   for (uint32_t I = 0; I < *Size; ++I) {
     auto FName(readSampleContextFromTable());
     if (std::error_code EC = FName.getError())
----------------
FName -> FContext


================
Comment at: llvm/lib/ProfileData/SampleProfReader.cpp:742
+    if (FuncOffsetsOrdered)
+      OrderedFuncOffsets->emplace_back(*FName, *Offset);
   }
----------------
assert on the order comparing to OrderedFuncOffsets->back()?


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:44
 
+static cl::opt<bool> SortFuncOffsetTable(
+    "sort-func-offsets", cl::Hidden, cl::init(true),
----------------
Why do we need a flag? Can we simplify this by always order the function offset table for CSSPGO profile? 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109036/new/

https://reviews.llvm.org/D109036



More information about the llvm-commits mailing list