[PATCH] D96434: [CSSPGO][llvm-profgen] Filter out the instructions without location info for symbolizer

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 17:19:09 PST 2021


hoy added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:98
   KeyStr->Context = Binary->getExpandedContextStr(Stack);
+  if (KeyStr->Context.empty())
+    return nullptr;
----------------
wlei wrote:
> hoy wrote:
> > Can we not return null here and instead just check if the return value has empty string below? 
> This is a polymorphism function, for the callee the base class's not straightforward to get the `Context` string value. Or make a virtual function `isEmpty` for them?
I see. It's fine to leave it as is. A virtual method adds additional cost. A null key can be used to identify bad line numbers.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96434



More information about the llvm-commits mailing list