chromium-src-build/internal
sebmarchand@chromium.org 91d2a90b17 Add PGO targets to Chrome.
This allows to do a PGO optimized build of Chrome with the following commands:
python build\gyp_chromium -Dchrome_pgo_phase=1
ninja -C out\Release chrome
run with '--no-sandbox' + pgosweep
python build\gyp_chromium -Dchrome_pgo_phase=2
ninja -C out\Release chrome


----- Approach that didn't worked -----

(see comment #13 to know why this didn't work)

Instead of having the following gyp dependency chain (for a regular build), here '->' means 'depends on': 

'chrome'->|'chrome_main_dll'
----------|'chrome_child_dll'

we know have the following one (when chrome_pgo==1):
'chrome'->|'chrome_main_dll' |->'chrome_pgo_optimize'->|'chrome_main_dll_pgi'
----------|'chrome_child_dll'|-------------------------|'chrome_child_dll_pgi'


The '*_pgi' target correspond to the instrumented dll, the name of the DLLs produced by target will be terminated by '_pgi'.

During the 'chrome_pgo_optimize' step the instrumented DLLs will be renamed (the '_pgi' suffix will be removed) and Chrome will be run against a set of profile test cases, pgosweep.exe will also be invoked to collect the instrumentation data.

Then the main targets ('chrome_main_dll' and 'chrome_child_dll') will be linked with the flag /LTCG:PGOPTIMIZE, this will produce the optimized DLLs.
--------------------------------------------

R=scottmg@chromium.org

BUG=

Review URL: https://codereview.chromium.org/187813008

git-svn-id: http://src.chromium.org/svn/trunk/src/build@257133 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-14 16:48:30 +00:00
..
README.chromium Dropping unneeded set of vsprops. 2009-12-30 04:39:17 +00:00
release_defaults.gypi With this change, each target can select an optimization level for Windows official builds by setting a variable name "optimize" to one of three possible values: 2011-12-20 21:37:37 +00:00
release_impl.gypi Disable fpo one more time, this time for non-official (canary) builds. 2012-02-09 21:04:32 +00:00
release_impl_official.gypi Add PGO targets to Chrome. 2014-03-14 16:48:30 +00:00

README.chromium

Internal property sheets:
  essential.vsprops
    Contains the common settings used throughout the projects. Is included by either ..\debug.vsprops or ..\release.vsprops, so in general, it is not included directly.

  release_defaults.vsprops
    Included by ..\release.vsprops. Its settings are overriden by release_impl$(CHROME_BUILD_TYPE).vsprops. Uses the default VS setting which is "Maximize Speed". Results in relatively fast build with reasonable optimization level but without whole program optimization to reduce build time.

  release_impl.vsprops
    Included by ..\release.vsprops by default when CHROME_BUILD_TYPE is undefined. Includes release_defaults.vsprops.

  release_impl_checksenabled.vsprops
    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_checksenabled. Matches what release_defaults.vsprops does, but doesn't actually inherit from it as we couldn't quite get that working. The only difference is that _DEBUG is set instead of NDEBUG. Used for keeping debug checks enabled with a build that is fast enough to dogfood with.

  release_impl_official.vsprops
    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_official. Includes release_defaults.vsprops. Enables Whole Program Optimizations (WPO), which doubles the build time. Results in much more optimized build. Uses "Full Optimization" and "Flavor small code".

  release_impl_pgo_instrument.vsprops
    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_pgo_instrument. Includes release_defaults.vsprops. Enables Profile Guided Optimization (PGO) instrumentation (first pass). Uses "Full Optimization" and "Flavor small code".

  release_impl_pgo_optimize.vsprops
    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_pgo_optimize. Includes release_defaults.vsprops. Enables Profile Guided Optimization (PGO) optimization (second pass). Uses "Full Optimization" and "Flavor small code".

  release_impl_purify.vsprops
    Included by ..\release.vsprops when CHROME_BUILD_TYPE=_purify. Includes release_defaults.vsprops. Disables optimizations. Used with Purify to test without debug tools and without optimization; i.e. NDEBUG is defined but the compiler doesn't optimize the binary.