Commit f79918a7 authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Makes |chrome_pgo_phase==2| use the downloaded profiles.

This integrates the PGO build config with the new gclient hooks added in
https://chromium-review.googlesource.com/c/chromium/src/+/2165448

Bug: 1056189
Change-Id: Ie165c3355496ac539836ee36903a51a1e585cbf1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107728Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#763536}
parent 5fd0c03a
......@@ -1972,9 +1972,15 @@ config("default_stack_frames") {
# Default "optimization on" config.
config("optimize") {
if (is_win) {
# Favor size over speed, /O1 must be before the common flags.
# /O1 implies /Os and /GF.
cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
if (chrome_pgo_phase != 2) {
# Favor size over speed, /O1 must be before the common flags.
# /O1 implies /Os and /GF.
cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
} else {
# PGO requires all translation units to be compiled with /O2. The actual
# optimization level will be decided based on the profiling data.
cflags = [ "/O2" ] + common_optimize_on_cflags + [ "/Oi" ]
}
} else if (optimize_for_size && !is_nacl) {
# Favor size over speed.
# TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl
......
......@@ -35,6 +35,28 @@ config("pgo_optimization_flags") {
# Only add flags when chrome_pgo_phase == 2, so that variables we would use
# are not required to be defined when we're not actually using PGO.
if (chrome_pgo_phase == 2 && is_clang && !is_nacl && is_a_target_toolchain) {
_pgo_target = ""
if (is_win) {
if (target_cpu == "x64") {
_pgo_target = "win64"
} else {
_pgo_target = "win32"
}
} else if (is_mac) {
_pgo_target = "mac"
}
if (pgo_data_path == "" && _pgo_target != "") {
pgo_data_path = rebase_path(exec_script("//tools/update_pgo_profiles.py",
[
"--target",
_pgo_target,
"get_profile_path",
],
"value"),
root_build_dir)
}
assert(pgo_data_path != "",
"Please set pgo_data_path to point at the profile data")
cflags = [
......
......@@ -11,6 +11,7 @@ build_dotfile_settings = {
"//build/config/android/internal_rules.gni",
"//build/config/android/rules.gni",
"//build/config/compiler/BUILD.gn",
"//build/config/compiler/pgo/BUILD.gn",
"//build/config/gcc/gcc_version.gni",
"//build/config/host_byteorder.gni",
"//build/config/ios/ios_sdk.gni",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment