[PATCH] D103178: [CSSPGO][llvm-profgen] Allow multiple executable load segments.

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 13 17:55:24 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:332-334
+    const auto &Offsets = Binary.getExeSegmentOffsets();
+    auto It = std::lower_bound(Offsets.begin(), Offsets.end(), Event.Offset);
+    if (It != Offsets.end() && *It == Event.Offset) {
----------------
wenlei wrote:
> This could be simplified if we store ExeSegmentOffsets as a std::set<uint64_t>, and let getExeSegmentOffsets return std::set<uint64_t>&?
nvm, I see that you need the range search to find the containing segment later, in which case set won't work. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103178



More information about the llvm-commits mailing list