Bug 1483779 - Enable PGO on clang-cl 32-bits builds. r=dmajor
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 16 Aug 2018 16:44:36 +0900
changeset 432088 b2ec1606871f2c6021b41f7043a42f58ab9a5cb4
parent 432087 6ac9bb47e988cea5c3828f4fb5e9688d9bc7d148
child 432089 5a0c5138ce9ec748d54931643fffcbf378b47948
push id34458
push userebalazs@mozilla.com
push dateFri, 17 Aug 2018 09:46:42 +0000
treeherdermozilla-central@b84213ec5a4d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdmajor
bugs1483779
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1483779 - Enable PGO on clang-cl 32-bits builds. r=dmajor
Makefile.in
build/moz.configure/toolchain.configure
--- a/Makefile.in
+++ b/Makefile.in
@@ -306,21 +306,18 @@ package-generated-sources:
 # PGO support, but we can't do this test in client.mk
 # No point in clobbering if PGO has been explicitly disabled.
 ifdef NO_PROFILE_GUIDED_OPTIMIZE
 maybe_clobber_profiledbuild:
 else
 ifneq ($(CC_TYPE),msvc)
 maybe_clobber_profiledbuild: clean
 ifneq (,$(findstring clang,$(CC_TYPE)))
-# 32-bit Windows PGO is currently blocked by bug 1479800
-ifneq ($(CC_TYPE)_$(CPU_ARCH),clang-cl_x86)
 	$(LLVM_PROFDATA) merge -o $(DEPTH)/merged.profdata $(DEPTH)/*.profraw
 endif
-endif
 else
 maybe_clobber_profiledbuild:
 	$(RM) $(DIST)/bin/*.pgc
 	find $(DIST)/$(MOZ_APP_NAME) -name '*.pgc' -exec mv {} $(DIST)/bin \;
 endif # msvc
 endif # NO_PROFILE_GUIDED_OPTIMIZE
 
 .PHONY: maybe_clobber_profiledbuild
--- a/build/moz.configure/toolchain.configure
+++ b/build/moz.configure/toolchain.configure
@@ -1257,19 +1257,20 @@ def pgo_flags(compiler, build_env, targe
             use_cflags=['-fprofile-use', '-fprofile-correction',
                         '-Wcoverage-mismatch'],
             use_ldflags=['-fprofile-use'],
         )
 
     if compiler.type in ('clang-cl', 'clang'):
         profdata = os.path.join(topobjdir, 'merged.profdata')
         if compiler.type == 'clang-cl':
-            # 32-bit PGO is currently blocked by bug 1479800
             if target.cpu == 'x86_64':
                 gen_ldflags = ['clang_rt.profile-x86_64.lib']
+            elif target.cpu == 'x86':
+                gen_ldflags = ['clang_rt.profile-i386.lib']
             else:
                 gen_ldflags = None
         else:
             gen_ldflags = ['-fprofile-instr-generate']
 
         if gen_ldflags:
             return namespace(
                 gen_cflags=['-fprofile-instr-generate'],