[PATCH] D110275: [llvm-profgen] Fix a dangling vector reference in CS line number based generator

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 22 13:18:58 PDT 2021


wlei added a comment.

In D110275#3016049 <https://reviews.llvm.org/D110275#3016049>, @wenlei wrote:

> lgtm. so the problem was with profile generation without probe, right?

Yeah, this is for CS line-number based generation which we didn't test for large service.



================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:228
+    SampleContext FContext(NewContext, RawContext);
+    auto Ret = ProfileMap.emplace(FContext, FunctionSamples());
     if (WasLeafInlined)
----------------
Side note:

This might be improved in the future, if it's a new context, it will always do a twice search(find and emplace), I guess context search is heavy.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110275



More information about the llvm-commits mailing list