mozilla-pgo.patch
branchfirefox85
changeset 1154 71a92b4d0527
parent 1152 4cfe46c9a944
child 1155 b8c834aafde2
equal deleted inserted replaced
1153:fdd746757dda 1154:71a92b4d0527
     1 # HG changeset patch
     1 # HG changeset patch
     2 # User Wolfgang Rosenauer <wr@rosenauer.org>
     2 # User Wolfgang Rosenauer <wr@rosenauer.org>
     3 # Parent  431962e810598b34327620fb99e06768e9a29c38
     3 # Parent  41df71ef2798d6bd6a67cfc4c4f26b8d41b8ccca
     4 
     4 
     5 diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure
     5 diff --git a/build/moz.configure/lto-pgo.configure b/build/moz.configure/lto-pgo.configure
     6 --- a/build/moz.configure/lto-pgo.configure
     6 --- a/build/moz.configure/lto-pgo.configure
     7 +++ b/build/moz.configure/lto-pgo.configure
     7 +++ b/build/moz.configure/lto-pgo.configure
     8 @@ -223,23 +223,23 @@ def lto(value, c_compiler, ld64_known_go
     8 @@ -235,23 +235,23 @@ def lto(
     9                  "configure."
     9                  "configure."
    10              )
    10              )
    11  
    11  
    12          if c_compiler.type == "clang":
    12          if c_compiler.type == "clang":
    13              if len(value) and value[0].lower() == "full":
    13              if len(value) and value[0].lower() == "full":
    30  
    30  
    31              # Explicitly set the CPU to optimize for so the linker doesn't
    31              # Explicitly set the CPU to optimize for so the linker doesn't
    32              # choose a poor default.  Rust compilation by default uses the
    32              # choose a poor default.  Rust compilation by default uses the
    33              # pentium4 CPU on x86:
    33              # pentium4 CPU on x86:
    34              #
    34              #
    35 @@ -263,17 +263,17 @@ def lto(value, c_compiler, ld64_known_go
       
    36                  ldflags.append("-mllvm:-mcpu=x86-64")
       
    37              # We do not need special flags for arm64.  Hooray for fixed-length
       
    38              # instruction sets.
       
    39          else:
       
    40              num_cores = multiprocessing.cpu_count()
       
    41              if len(value) and value[0].lower() == "full":
       
    42                  cflags.append("-flto")
       
    43              else:
       
    44 -                cflags.append("-flto=thin")
       
    45 +                cflags.append("-flto")
       
    46              cflags.append("-flifetime-dse=1")
       
    47  
       
    48              ldflags.append("-flto=%s" % num_cores)
       
    49              ldflags.append("-flifetime-dse=1")
       
    50  
       
    51          # Tell LTO not to inline functions above a certain size, to mitigate
       
    52          # binary size growth while still getting good performance.
       
    53          # (For hot functions, PGO will put a multiplier on this limit.)
       
    54 diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
    35 diff --git a/build/pgo/profileserver.py b/build/pgo/profileserver.py
    55 --- a/build/pgo/profileserver.py
    36 --- a/build/pgo/profileserver.py
    56 +++ b/build/pgo/profileserver.py
    37 +++ b/build/pgo/profileserver.py
    57 @@ -6,17 +6,17 @@
    38 @@ -6,17 +6,17 @@
    58  
    39  
   171  
   152  
   172  if CONFIG["CC_TYPE"] in ("clang", "gcc"):
   153  if CONFIG["CC_TYPE"] in ("clang", "gcc"):
   173      CXXFLAGS += ["-Wno-error=shadow"]
   154      CXXFLAGS += ["-Wno-error=shadow"]
   174 +
   155 +
   175 +CXXFLAGS += ['-fno-devirtualize']
   156 +CXXFLAGS += ['-fno-devirtualize']
   176 diff --git a/python/mozbuild/mozbuild/build_commands.py b/python/mozbuild/mozbuild/build_commands.py
       
   177 --- a/python/mozbuild/mozbuild/build_commands.py
       
   178 +++ b/python/mozbuild/mozbuild/build_commands.py
       
   179 @@ -121,19 +121,18 @@ class Build(MachCommandBase):
       
   180                  silent=not verbose,
       
   181                  ensure_exit_code=False,
       
   182                  append_env=append_env,
       
   183              )
       
   184              if status != 0:
       
   185                  return status
       
   186  
       
   187              pgo_env = os.environ.copy()
       
   188 -            pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get(
       
   189 -                "LLVM_PROFDATA"
       
   190 -            )
       
   191 +            if instr.config_environment.substs.get('CC_TYPE') != 'gcc':
       
   192 +                pgo_env["LLVM_PROFDATA"] = instr.config_environment.substs.get("LLVM_PROFDATA")
       
   193              pgo_env["JARLOG_FILE"] = mozpath.join(orig_topobjdir, "jarlog/en-US.log")
       
   194              pgo_cmd = [
       
   195                  instr.virtualenv_manager.python_path,
       
   196                  mozpath.join(self.topsrcdir, "build/pgo/profileserver.py"),
       
   197              ]
       
   198              subprocess.check_call(
       
   199                  pgo_cmd, cwd=instr.topobjdir, env=ensure_subprocess_env(pgo_env)
       
   200              )
       
   201 diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp
   157 diff --git a/toolkit/components/terminator/nsTerminator.cpp b/toolkit/components/terminator/nsTerminator.cpp
   202 --- a/toolkit/components/terminator/nsTerminator.cpp
   158 --- a/toolkit/components/terminator/nsTerminator.cpp
   203 +++ b/toolkit/components/terminator/nsTerminator.cpp
   159 +++ b/toolkit/components/terminator/nsTerminator.cpp
   204 @@ -413,16 +413,21 @@ void nsTerminator::StartWatchdog() {
   160 @@ -425,16 +425,21 @@ void nsTerminator::StartWatchdog() {
   205        // Defend against overflow
   161        // Defend against overflow
   206        crashAfterMS = INT32_MAX;
   162        crashAfterMS = INT32_MAX;
   207      } else {
   163      } else {
   208        crashAfterMS *= scaleUp;
   164        crashAfterMS *= scaleUp;
   209      }
   165      }