From ab5ac659c81a453a3f58df94f39fe8ba3cd35918 Mon Sep 17 00:00:00 2001 From: Hongtao Yu Date: Thu, 22 Jul 2021 14:41:55 -0700 Subject: [PATCH] [CSSPGO] Fix a typo in SampleContextTracker 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp index cb1245f..55b88ac 100644 --- a/llvm/lib/Transforms/IPO/SampleContextTracker.cpp +++ b/llvm/lib/Transforms/IPO/SampleContextTracker.cpp @@ -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; } -- 2.7.4