]> granicus.if.org Git - clang/commitdiff
PGO] PGOFuncName meta data if PGOFuncName is different from function's raw name
authorRong Xu <xur@google.com>
Fri, 22 Apr 2016 21:19:05 +0000 (21:19 +0000)
committerRong Xu <xur@google.com>
Fri, 22 Apr 2016 21:19:05 +0000 (21:19 +0000)
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

lib/CodeGen/CodeGenPGO.cpp

index 7e89492f1c6ea8529911d0c62cda259325954b5a..43bc37c49f7d53b7a2af526d83c2c0d2621135f1 100644 (file)
@@ -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 {