summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsebmarchand <sebmarchand@chromium.org>2016-01-04 14:28:39 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-04 22:29:36 +0000
commit64c2bb0135460b7fb52e56f53d4b9369d7035eba (patch)
treedb08333eeb3248cddb43745081e69cb51b44e0db
parentad5b312e155f67ae7d0a8e025e16c39682bc5baa (diff)
downloadchromium_src-64c2bb0135460b7fb52e56f53d4b9369d7035eba.zip
chromium_src-64c2bb0135460b7fb52e56f53d4b9369d7035eba.tar.gz
chromium_src-64c2bb0135460b7fb52e56f53d4b9369d7035eba.tar.bz2
Add support for PGO in the Win GN builds.
PGO is only used on chrome_child.dll for now. BUG=512851 Review URL: https://codereview.chromium.org/1556093002 Cr-Commit-Position: refs/heads/master@{#367389}
-rw-r--r--chrome/BUILD.gn37
1 files changed, 20 insertions, 17 deletions
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 0548573..d741423 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -18,6 +18,15 @@ declare_args() {
# up when Chrome is not run from the command line, so should only be used for
# development. Only has an effect on Windows builds.
win_console_app = false
+
+ # Specify the current PGO phase, only used for the Windows MSVS build. Here's
+ # the different values that can be used:
+ # 0 : Means that PGO is turned off.
+ # 1 : Used during the PGI (instrumentation) phase.
+ # 2 : Used during the PGO (optimization) phase.
+ #
+ # TODO(sebmarchand): Add support for the PGU (update) phase.
+ chrome_pgo_phase = 0
}
if (is_android) {
@@ -332,8 +341,6 @@ if (is_mac || is_win) {
configs -= [ "//build/config/win:default_incremental_linking" ]
configs +=
[ "//build/config/win:default_large_module_incremental_linking" ]
-
- # TODO(GYP) bug 512851: PGO.
}
if (use_aura) {
@@ -421,21 +428,17 @@ if (is_mac || is_win) {
configs -= [ "//build/config/win:default_incremental_linking" ]
configs += [ "//build/config/win:no_incremental_linking" ]
}
- # TODO(GYP) bug 512851: PGO on Windows.
- # ['chrome_pgo_phase==1', {
- # 'msvs_settings': {
- # 'VCLinkerTool': {
- # 'LinkTimeCodeGeneration': '2',
- # },
- # },
- # }],
- # ['chrome_pgo_phase==2', {
- # 'msvs_settings': {
- # 'VCLinkerTool': {
- # 'LinkTimeCodeGeneration': '3',
- # },
- # },
- # }],
+ if (chrome_pgo_phase > 0) {
+ configs += [ "//build/config/compiler:optimize_max" ]
+ }
+ if (chrome_pgo_phase == 1) {
+ ldflags = [
+ "/LTCG:PGINSTRUMENT",
+ "/PogoSafeMode",
+ ]
+ } else if (chrome_pgo_phase == 2) {
+ ldflags = [ "/LTCG:PGOPTIMIZE" ]
+ }
}
if (enable_configuration_policy) {