diff options
author | Easwaran Raman <eraman@google.com> | 2015-12-17 19:14:27 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2015-12-17 19:14:27 +0000 |
commit | 695890c971f4c89da9a9d61e3b430f2e0cb49a83 (patch) | |
tree | 83b2b426691bb70cc9c2002d38aed85adbbe1f98 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 1ad3bba74738d5980f91cb4bbcf7887159533ffa (diff) | |
download | llvm-695890c971f4c89da9a9d61e3b430f2e0cb49a83.zip llvm-695890c971f4c89da9a9d61e3b430f2e0cb49a83.tar.gz llvm-695890c971f4c89da9a9d61e3b430f2e0cb49a83.tar.bz2 |
Attach maximum function count to Module when using PGO mode.
This sets the maximum entry count among all functions in the program to the module using module flags. This allows the optimizer to use this information.
Differential Revision: http://reviews.llvm.org/D15163
llvm-svn: 255918
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 3b3fc87..173b0dc 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -375,8 +375,11 @@ void CodeGenModule::Release() { if (llvm::Function *CudaDtorFunction = CUDARuntime->makeModuleDtorFunction()) AddGlobalDtor(CudaDtorFunction); } - if (PGOReader && PGOStats.hasDiagnostics()) - PGOStats.reportDiagnostics(getDiags(), getCodeGenOpts().MainFileName); + if (PGOReader) { + getModule().setMaximumFunctionCount(PGOReader->getMaximumFunctionCount()); + if (PGOStats.hasDiagnostics()) + PGOStats.reportDiagnostics(getDiags(), getCodeGenOpts().MainFileName); + } EmitCtorList(GlobalCtors, "llvm.global_ctors"); EmitCtorList(GlobalDtors, "llvm.global_dtors"); EmitGlobalAnnotations(); |