diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-20 20:00:41 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-20 20:00:41 +0000 |
commit | a7807637bf967af9df6fec3c1778ccd0aa74817b (patch) | |
tree | aaf1424a7c9cda68161b5a3bdca06cdcf8822087 /clang/lib/CodeGen | |
parent | 6dab520c70a25f43f288f9875faf1e8df5a80c3a (diff) | |
download | bcm5719-llvm-a7807637bf967af9df6fec3c1778ccd0aa74817b.tar.gz bcm5719-llvm-a7807637bf967af9df6fec3c1778ccd0aa74817b.zip |
PGO: Change runtime prefix from pgo to profile
These functions are in the profile runtime. PGO comes later.
Unfortunately, there's only room for 16 characters in a Darwin section,
so use __llvm_prf_ instead of __llvm_profile_ for section names.
<rdar://problem/15943240>
llvm-svn: 204390
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.cpp | 16 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenPGO.h | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index 96409fef64b..2dbe88cb277 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -178,7 +178,7 @@ void CodeGenPGO::setFuncName(llvm::Function *Fn) { } static llvm::Function *getRegisterFunc(CodeGenModule &CGM) { - return CGM.getModule().getFunction("__llvm_pgo_register_functions"); + return CGM.getModule().getFunction("__llvm_profile_register_functions"); } static llvm::BasicBlock *getOrInsertRegisterBB(CodeGenModule &CGM) { @@ -195,7 +195,7 @@ static llvm::BasicBlock *getOrInsertRegisterBB(CodeGenModule &CGM) { auto *RegisterFTy = llvm::FunctionType::get(VoidTy, false); auto *RegisterF = llvm::Function::Create(RegisterFTy, llvm::GlobalValue::InternalLinkage, - "__llvm_pgo_register_functions", + "__llvm_profile_register_functions", &CGM.getModule()); RegisterF->setUnnamedAddr(true); if (CGM.getCodeGenOpts().DisableRedZone) @@ -212,7 +212,7 @@ static llvm::Constant *getOrInsertRuntimeRegister(CodeGenModule &CGM) { auto *VoidTy = llvm::Type::getVoidTy(CGM.getLLVMContext()); auto *VoidPtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext()); auto *RuntimeRegisterTy = llvm::FunctionType::get(VoidTy, VoidPtrTy, false); - return CGM.getModule().getOrInsertFunction("__llvm_pgo_register_function", + return CGM.getModule().getOrInsertFunction("__llvm_profile_register_function", RuntimeRegisterTy); } @@ -221,15 +221,15 @@ static bool isMachO(const CodeGenModule &CGM) { } static StringRef getCountersSection(const CodeGenModule &CGM) { - return isMachO(CGM) ? "__DATA,__llvm_pgo_cnts" : "__llvm_pgo_cnts"; + return isMachO(CGM) ? "__DATA,__llvm_prf_cnts" : "__llvm_prf_cnts"; } static StringRef getNameSection(const CodeGenModule &CGM) { - return isMachO(CGM) ? "__DATA,__llvm_pgo_names" : "__llvm_pgo_names"; + return isMachO(CGM) ? "__DATA,__llvm_prf_names" : "__llvm_prf_names"; } static StringRef getDataSection(const CodeGenModule &CGM) { - return isMachO(CGM) ? "__DATA,__llvm_pgo_data" : "__llvm_pgo_data"; + return isMachO(CGM) ? "__DATA,__llvm_prf_data" : "__llvm_prf_data"; } llvm::GlobalVariable *CodeGenPGO::buildDataVar() { @@ -295,7 +295,7 @@ llvm::Function *CodeGenPGO::emitInitialization(CodeGenModule &CGM) { return nullptr; // Only need to create this once per module. - if (CGM.getModule().getFunction("__llvm_pgo_init")) + if (CGM.getModule().getFunction("__llvm_profile_init")) return nullptr; // Get the function to call at initialization. @@ -307,7 +307,7 @@ llvm::Function *CodeGenPGO::emitInitialization(CodeGenModule &CGM) { auto *VoidTy = llvm::Type::getVoidTy(CGM.getLLVMContext()); auto *F = llvm::Function::Create(llvm::FunctionType::get(VoidTy, false), llvm::GlobalValue::InternalLinkage, - "__llvm_pgo_init", &CGM.getModule()); + "__llvm_profile_init", &CGM.getModule()); F->setUnnamedAddr(true); F->addFnAttr(llvm::Attribute::NoInline); if (CGM.getCodeGenOpts().DisableRedZone) diff --git a/clang/lib/CodeGen/CodeGenPGO.h b/clang/lib/CodeGen/CodeGenPGO.h index e859324ae08..d22486d372d 100644 --- a/clang/lib/CodeGen/CodeGenPGO.h +++ b/clang/lib/CodeGen/CodeGenPGO.h @@ -83,7 +83,7 @@ public: /// For functions with local linkage, this includes the main file name. StringRef getFuncName() const { return StringRef(*PrefixedFuncName); } std::string getFuncVarName(StringRef VarName) const { - return ("__llvm_pgo_" + VarName + "_" + RawFuncName).str(); + return ("__llvm_profile_" + VarName + "_" + RawFuncName).str(); } /// Return the counter value of the current region. |