<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 16, 2016 at 1:49 PM, Vedant Kumar via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: vedantk<br>
Date: Wed Mar 16 15:49:26 2016<br>
New Revision: 263662<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=263662&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=263662&view=rev</a><br>
Log:<br>
[ProfileData] Make a utility method public, NFC<br>
<br>
The swift frontend needs to be able to look up PGO function name<br>
variables based on the original raw function name. That's because it's<br>
not possible to create PGO function name variables while emitting swift<br>
IR. Instead, we have to create the name variables while lowering swift<br>
IR to llvm IR, at which point we fix up all calls to the increment<br>
intrinsic to point to the right name variable.<br>
<br></blockquote><div><br></div><div>I am not sure I understand the need of the change. The name of the PGO name variable is purely implementation detail -- so it can be anything as long as there is no conflict. What matters is the 'content'/initializer of the name variable which is well specified.</div><div><br></div><div>thanks,</div><div><br></div><div>David</div><div><br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Modified:<br>
llvm/trunk/include/llvm/ProfileData/InstrProf.h<br>
llvm/trunk/lib/ProfileData/InstrProf.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/ProfileData/InstrProf.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=263662&r1=263661&r2=263662&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ProfileData/InstrProf.h?rev=263662&r1=263661&r2=263662&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/ProfileData/InstrProf.h (original)<br>
+++ llvm/trunk/include/llvm/ProfileData/InstrProf.h Wed Mar 16 15:49:26 2016<br>
@@ -165,6 +165,12 @@ std::string getPGOFuncName(StringRef Raw<br>
StringRef FileName,<br>
uint64_t Version = INSTR_PROF_INDEX_VERSION);<br>
<br>
+/// Return the name of the global variable used to store a function<br>
+/// name in PGO instrumentation. \c FuncName is the name of the function<br>
+/// returned by the \c getPGOFuncName call.<br>
+std::string getPGOFuncNameVarName(StringRef FuncName,<br>
+ GlobalValue::LinkageTypes Linkage);<br>
+<br>
/// Create and return the global variable for function name used in PGO<br>
/// instrumentation. \c FuncName is the name of the function returned<br>
/// by \c getPGOFuncName call.<br>
<br>
Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=263662&r1=263661&r2=263662&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileData/InstrProf.cpp?rev=263662&r1=263661&r2=263662&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)<br>
+++ llvm/trunk/lib/ProfileData/InstrProf.cpp Wed Mar 16 15:49:26 2016<br>
@@ -99,8 +99,8 @@ StringRef getFuncNameWithoutPrefix(Strin<br>
<br>
// \p FuncName is the string used as profile lookup key for the function. A<br>
// symbol is created to hold the name. Return the legalized symbol name.<br>
-static std::string getPGOFuncNameVarName(StringRef FuncName,<br>
- GlobalValue::LinkageTypes Linkage) {<br>
+std::string getPGOFuncNameVarName(StringRef FuncName,<br>
+ GlobalValue::LinkageTypes Linkage) {<br>
std::string VarName = getInstrProfNameVarPrefix();<br>
VarName += FuncName;<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>