[CSSPGO] Fix a typo in SampleContextTracker
authorHongtao Yu <hoy@fb.com>
Thu, 22 Jul 2021 21:41:55 +0000 (14:41 -0700)
committerHongtao Yu <hoy@fb.com>
Thu, 22 Jul 2021 23:44:50 +0000 (16:44 -0700)
Fixing a typo in SampleContextTracker to use debug name when debug linkage name is no present. This should only affect C programs.

Saw 0.6% perf win on Cinder which is mostly C code.

Reviewed By: wenlei, wmi

Differential Revision: https://reviews.llvm.org/D106599

llvm/lib/Transforms/IPO/SampleContextTracker.cpp

index cb1245f..55b88ac 100644 (file)
@@ -433,8 +433,7 @@ ContextTrieNode *SampleContextTracker::getContextFor(const DILocation *DIL) {
     if (Name.empty())
       Name = PrevDIL->getScope()->getSubprogram()->getName();
     S.push_back(
-        std::make_pair(FunctionSamples::getCallSiteIdentifier(DIL),
-                       PrevDIL->getScope()->getSubprogram()->getLinkageName()));
+        std::make_pair(FunctionSamples::getCallSiteIdentifier(DIL), Name));
     PrevDIL = DIL;
   }