[PATCH] D112948: [SamplePGO] Fix callsite sample lookup to use dwarf names when dwarf linkage name isn't available.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 1 18:43:55 PDT 2021


hoy added inline comments.


================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:253-254
+      Name = PrevDIL->getScope()->getSubprogram()->getName();
     S.push_back(
-        std::make_pair(LineLocation(getOffset(DIL), Discriminator),
-                       PrevDIL->getScope()->getSubprogram()->getLinkageName()));
+        std::make_pair(FunctionSamples::getCallSiteIdentifier(DIL), Name));
     PrevDIL = DIL;
----------------
wenlei wrote:
> What I meant is - can we just do this for now and avoid changes in getCallSiteIdentifier? If we want to fix FSAFDO, we can do it in a separate patch. 
> 
> ```
> 
> // Use C++ linkage name if possible.
> StringRef Name = PrevDIL->getScope()->getSubprogram()->getLinkageName();
> if (Name.empty())
>     Name = PrevDIL->getScope()->getSubprogram()->getName();
> 
> S.push_back(
>         std::make_pair(LineLocation(getOffset(DIL), Discriminator), Name));
> ```
This looks good for this change. I was saying the getCallSiteIdentifier change is still needed to make probe-based nested profile work since the currently it only deals with line numbers in this function.




Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112948



More information about the llvm-commits mailing list