diff options
author | Easwaran Raman <eraman@google.com> | 2015-12-12 00:31:02 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2015-12-12 00:31:02 +0000 |
commit | d547e5e16842f13b4c78eb942d349c8f1c553148 (patch) | |
tree | f976aa654374ca9fd02a0c7eedb0b8720d8afef8 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 8f5549726408bec990b3a371cf8bcd8c4ff286fb (diff) | |
download | llvm-d547e5e16842f13b4c78eb942d349c8f1c553148.zip llvm-d547e5e16842f13b4c78eb942d349c8f1c553148.tar.gz llvm-d547e5e16842f13b4c78eb942d349c8f1c553148.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: 255397
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 29c5f3e..8d72549 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -376,6 +376,9 @@ void CodeGenModule::Release() { } if (PGOReader && PGOStats.hasDiagnostics()) PGOStats.reportDiagnostics(getDiags(), getCodeGenOpts().MainFileName); + // In PGO mode, attach maximum function count to the module. + if (PGOReader) + getModule().setMaximumFunctionCount(PGOReader->getMaximumFunctionCount()); EmitCtorList(GlobalCtors, "llvm.global_ctors"); EmitCtorList(GlobalDtors, "llvm.global_dtors"); EmitGlobalAnnotations(); |