From: Rong Xu Date: Fri, 22 Apr 2016 21:19:05 +0000 (+0000) Subject: PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=83402ed45b681e9f38ce6626e5899c19159ceb29;p=clang PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name Write out the PGOFuncName meta data if PGOFuncName is different from function's raw name. This should only apply to internal linkage functions. This is to be consumed by indirect-call promotion when called in LTO optimization pass. Differential Revision: http://reviews.llvm.org/D18624 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@267224 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenPGO.cpp b/lib/CodeGen/CodeGenPGO.cpp index 7e89492f1c..43bc37c49f 100644 --- a/lib/CodeGen/CodeGenPGO.cpp +++ b/lib/CodeGen/CodeGenPGO.cpp @@ -43,6 +43,8 @@ void CodeGenPGO::setFuncName(StringRef Name, void CodeGenPGO::setFuncName(llvm::Function *Fn) { setFuncName(Fn->getName(), Fn->getLinkage()); + // Create PGOFuncName meta data. + llvm::createPGOFuncNameMetadata(*Fn, FuncName); } namespace {