Bug 1443712 - Add /d2:-cgsummary to PGO link flags; r?build draft
authorGregory Szorc <gps@mozilla.com>
Tue, 06 Mar 2018 20:26:32 -0800
changeset 764069 667a924135763d50854bac8ae32fd1ee8cdb66d1
parent 763942 bccdc684210431c233622650a91454c09f6af9eb
push id101654
push userbmo:gps@mozilla.com
push dateWed, 07 Mar 2018 04:28:16 +0000
reviewersbuild
bugs1443712
milestone60.0a1
Bug 1443712 - Add /d2:-cgsummary to PGO link flags; r?build This will tell us which functions PGO is spending its time in, which functions are being optimized, and other interesting statistics. The output is a handful of pages of text in our current PGO builds and it seems useful for understanding the PGO black box. MozReview-Commit-ID: HUbAhltQrdL
build/moz.configure/toolchain.configure
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1261,17 +1261,20 @@ def pgo_flags(compiler):
             # treated as an error sometimes. This might be a consequence
             # of using WARNINGS_AS_ERRORS in some modules, combined
             # with the linker doing most of the work in the whole-program
             # optimization/PGO case. I think it's probably a compiler bug,
             # but we work around it here.
             use_cflags=['-GL', '-wd4624', '-wd4952'],
             # XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
             # Probably also a compiler bug, but what can you do?
-            use_ldflags=['-LTCG:PGUPDATE', cgthreads],
+            # /d2:-cgsummary prints a summary of what is happening during
+            # code generation. How long individual functions are optimized,
+            # which functions are optimized, etc.
+            use_ldflags=['-LTCG:PGUPDATE', cgthreads, '-d2:-cgsummary'],
         )
 
 
 set_config('PROFILE_GEN_CFLAGS', pgo_flags.gen_cflags)
 set_config('PROFILE_GEN_LDFLAGS', pgo_flags.gen_ldflags)
 set_config('PROFILE_USE_CFLAGS', pgo_flags.use_cflags)
 set_config('PROFILE_USE_LDFLAGS', pgo_flags.use_ldflags)