summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEaswaran Raman <eraman@google.com>2015-12-17 19:14:27 +0000
committerEaswaran Raman <eraman@google.com>2015-12-17 19:14:27 +0000
commit695890c971f4c89da9a9d61e3b430f2e0cb49a83 (patch)
tree83b2b426691bb70cc9c2002d38aed85adbbe1f98 /clang/lib/CodeGen/CodeGenModule.cpp
parent1ad3bba74738d5980f91cb4bbcf7887159533ffa (diff)
downloadbcm5719-llvm-695890c971f4c89da9a9d61e3b430f2e0cb49a83.tar.gz
bcm5719-llvm-695890c971f4c89da9a9d61e3b430f2e0cb49a83.zip
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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index 3b3fc877bf4..173b0dcba1c 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();
OpenPOWER on IntegriCloud