xref: /aosp_15_r20/external/angle/build/config/compiler/pgo/pgo.gni (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1# Copyright 2016 The Chromium Authors
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5import("//build/config/cast.gni")
6import("//build/config/chrome_build.gni")
7import("//build/config/chromeos/ui_mode.gni")
8import("//build/config/cronet/config.gni")
9import("//build/config/dcheck_always_on.gni")
10import("//build/config/features.gni")
11
12if (is_ios) {
13  import("//build/config/apple/mobile_config.gni")
14}
15
16declare_args() {
17  # Specify the current PGO phase.
18  # Here's the different values that can be used:
19  #     0 : Means that PGO is turned off.
20  #     1 : Used during the PGI (instrumentation) phase.
21  #     2 : Used during the PGO (optimization) phase.
22  # PGO profiles are generated from `dcheck_always_on = false` builds. Mixing
23  # those profiles with `dcheck_always_on = true` builds can cause the compiler
24  # to think some code is hotter than it actually is, potentially causing very
25  # bad compile times.
26  chrome_pgo_phase = 0
27  if (!is_cronet_build && !dcheck_always_on && is_official_build &&
28      # TODO(crbug.com/1336055): Update this now-outdated condition with regard
29      # to chromecast and determine whether chromeos_is_browser_only is
30      # obsolete.
31      (is_high_end_android || is_win || is_mac || is_fuchsia ||
32       (is_linux && !is_castos) ||
33       (is_ios && use_blink && target_environment == "device") ||
34       (is_chromeos_lacros && is_chromeos_device))) {
35    chrome_pgo_phase = 2
36  }
37
38  # When using chrome_pgo_phase = 2, read profile data from this path.
39  pgo_data_path = ""
40
41  # Whether to enable temporal pgo or not (experimental).
42  temporal_pgo_profile = false
43}
44