Bug 1382650 part 1 - Remove separate Ion warmup threshold for small functions, as it's equivalent to the normal one. r=nbp a=pascalc
☠☠ backed out by a330a9835751 ☠ ☠
authorNarcis Beleuzu <nbeleuzu@mozilla.com>
Sun, 07 Apr 2019 16:36:08 +0300
changeset 525994 7feb497c2ffe0d7a4c7b695fd1e2b423fb6e0b5c
parent 525993 35ecb4d0b9255d57e73ad5910434463ab3ebd064
child 525995 02cdde2f8dbd674f0ec37b666be214f883bf27e7
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp, pascalc
bugs1382650
milestone67.0
Bug 1382650 part 1 - Remove separate Ion warmup threshold for small functions, as it's equivalent to the normal one. r=nbp a=pascalc Summary: We used to have a different threshold for small functions but now they're both set to 1000 so there's no need to special-case small functions. Reviewers: nbp Reviewed By: nbp Bug #: 1382650 Differential Revision: https://phabricator.services.mozilla.com/D24153
js/src/jit/IonOptimizationLevels.cpp
js/src/jit/IonOptimizationLevels.h
js/src/jit/JitOptions.cpp
js/src/jit/JitOptions.h
--- a/js/src/jit/IonOptimizationLevels.cpp
+++ b/js/src/jit/IonOptimizationLevels.cpp
@@ -14,18 +14,16 @@ using namespace js::jit;
 
 namespace js {
 namespace jit {
 
 const OptimizationLevelInfo IonOptimizations;
 
 // Duplicated in all.js - ensure both match.
 const uint32_t OptimizationInfo::CompilerWarmupThreshold = 1000;
-const uint32_t OptimizationInfo::CompilerSmallFunctionWarmupThreshold =
-    CompilerWarmupThreshold;
 
 void OptimizationInfo::initNormalOptimizationInfo() {
   level_ = OptimizationLevel::Normal;
 
   autoTruncate_ = true;
   eaa_ = true;
   edgeCaseAnalysis_ = true;
   eliminateRedundantChecks_ = true;
@@ -44,17 +42,16 @@ void OptimizationInfo::initNormalOptimiz
   inlineMaxBytecodePerCallSiteHelperThread_ = 1100;
   inlineMaxCalleeInlinedBytecodeLength_ = 3550;
   inlineMaxTotalBytecodeLength_ = 85000;
   inliningMaxCallerBytecodeLength_ = 1600;
   maxInlineDepth_ = 3;
   scalarReplacement_ = true;
   smallFunctionMaxInlineDepth_ = 10;
   compilerWarmUpThreshold_ = CompilerWarmupThreshold;
-  compilerSmallFunctionWarmUpThreshold_ = CompilerSmallFunctionWarmupThreshold;
   inliningWarmUpThresholdFactor_ = 0.125;
   inliningRecompileThresholdFactor_ = 4;
 }
 
 void OptimizationInfo::initWasmOptimizationInfo() {
   // The Wasm optimization level
   // Disables some passes that don't work well with wasm.
 
@@ -79,22 +76,16 @@ uint32_t OptimizationInfo::compilerWarmU
 
   if (pc == script->code()) {
     pc = nullptr;
   }
 
   uint32_t warmUpThreshold = JitOptions.forcedDefaultIonWarmUpThreshold.valueOr(
       compilerWarmUpThreshold_);
 
-  if (JitOptions.isSmallFunction(script)) {
-    warmUpThreshold =
-        JitOptions.forcedDefaultIonSmallFunctionWarmUpThreshold.valueOr(
-            compilerSmallFunctionWarmUpThreshold_);
-  }
-
   // If the script is too large to compile on the main thread, we can still
   // compile it off thread. In these cases, increase the warm-up counter
   // threshold to improve the compilation's type information and hopefully
   // avoid later recompilation.
 
   if (script->length() > MAX_MAIN_THREAD_SCRIPT_SIZE) {
     warmUpThreshold *= (script->length() / double(MAX_MAIN_THREAD_SCRIPT_SIZE));
   }
--- a/js/src/jit/IonOptimizationLevels.h
+++ b/js/src/jit/IonOptimizationLevels.h
@@ -113,23 +113,16 @@ class OptimizationInfo {
 
   // How many invocations or loop iterations are needed before functions
   // are compiled.
   uint32_t compilerWarmUpThreshold_;
 
   // Default compiler warmup threshold, unless it is overridden.
   static const uint32_t CompilerWarmupThreshold;
 
-  // How many invocations or loop iterations are needed before small functions
-  // are compiled.
-  uint32_t compilerSmallFunctionWarmUpThreshold_;
-
-  // Default small function compiler warmup threshold, unless it is overridden.
-  static const uint32_t CompilerSmallFunctionWarmupThreshold;
-
   // How many invocations or loop iterations are needed before calls
   // are inlined, as a fraction of compilerWarmUpThreshold.
   double inliningWarmUpThresholdFactor_;
 
   // How many invocations or loop iterations are needed before a function
   // is hot enough to recompile the outerScript to inline that function,
   // as a multiplication of inliningWarmUpThreshold.
   uint32_t inliningRecompileThresholdFactor_;
@@ -154,17 +147,16 @@ class OptimizationInfo {
         inlineMaxBytecodePerCallSiteMainThread_(0),
         inlineMaxCalleeInlinedBytecodeLength_(0),
         inlineMaxTotalBytecodeLength_(0),
         inliningMaxCallerBytecodeLength_(0),
         maxInlineDepth_(0),
         scalarReplacement_(false),
         smallFunctionMaxInlineDepth_(0),
         compilerWarmUpThreshold_(0),
-        compilerSmallFunctionWarmUpThreshold_(0),
         inliningWarmUpThresholdFactor_(0.0),
         inliningRecompileThresholdFactor_(0) {}
 
   void initNormalOptimizationInfo();
   void initWasmOptimizationInfo();
 
   OptimizationLevel level() const { return level_; }
 
--- a/js/src/jit/JitOptions.cpp
+++ b/js/src/jit/JitOptions.cpp
@@ -203,29 +203,16 @@ DefaultJitOptions::DefaultJitOptions() {
     Maybe<int> value = ParseInt(env);
     if (value.isSome()) {
       forcedDefaultIonWarmUpThreshold.emplace(value.ref());
     } else {
       Warn(forcedDefaultIonWarmUpThresholdEnv, env);
     }
   }
 
-  // Same but for compiling small functions.
-  const char* forcedDefaultIonSmallFunctionWarmUpThresholdEnv =
-      "JIT_OPTION_forcedDefaultIonSmallFunctionWarmUpThreshold";
-  if (const char* env =
-          getenv(forcedDefaultIonSmallFunctionWarmUpThresholdEnv)) {
-    Maybe<int> value = ParseInt(env);
-    if (value.isSome()) {
-      forcedDefaultIonSmallFunctionWarmUpThreshold.emplace(value.ref());
-    } else {
-      Warn(forcedDefaultIonSmallFunctionWarmUpThresholdEnv, env);
-    }
-  }
-
   // Force the used register allocator instead of letting the optimization
   // pass decide.
   const char* forcedRegisterAllocatorEnv = "JIT_OPTION_forcedRegisterAllocator";
   if (const char* env = getenv(forcedRegisterAllocatorEnv)) {
     forcedRegisterAllocator = LookupRegisterAllocator(env);
     if (!forcedRegisterAllocator.isSome()) {
       Warn(forcedRegisterAllocatorEnv, env);
     }
@@ -289,25 +276,21 @@ bool DefaultJitOptions::isSmallFunction(
 
 void DefaultJitOptions::enableGvn(bool enable) { disableGvn = !enable; }
 
 void DefaultJitOptions::setEagerCompilation() {
   eagerCompilation = true;
   baselineWarmUpThreshold = 0;
   forcedDefaultIonWarmUpThreshold.reset();
   forcedDefaultIonWarmUpThreshold.emplace(0);
-  forcedDefaultIonSmallFunctionWarmUpThreshold.reset();
-  forcedDefaultIonSmallFunctionWarmUpThreshold.emplace(0);
 }
 
 void DefaultJitOptions::setCompilerWarmUpThreshold(uint32_t warmUpThreshold) {
   forcedDefaultIonWarmUpThreshold.reset();
   forcedDefaultIonWarmUpThreshold.emplace(warmUpThreshold);
-  forcedDefaultIonSmallFunctionWarmUpThreshold.reset();
-  forcedDefaultIonSmallFunctionWarmUpThreshold.emplace(warmUpThreshold);
 
   // Undo eager compilation
   if (eagerCompilation && warmUpThreshold != 0) {
     jit::DefaultJitOptions defaultValues;
     eagerCompilation = false;
     baselineWarmUpThreshold = defaultValues.baselineWarmUpThreshold;
   }
 }
--- a/js/src/jit/JitOptions.h
+++ b/js/src/jit/JitOptions.h
@@ -92,17 +92,16 @@ struct DefaultJitOptions {
   uint32_t branchPruningHitCountFactor;
   uint32_t branchPruningInstFactor;
   uint32_t branchPruningBlockSpanFactor;
   uint32_t branchPruningEffectfulInstFactor;
   uint32_t branchPruningThreshold;
   uint32_t wasmBatchIonThreshold;
   uint32_t wasmBatchBaselineThreshold;
   mozilla::Maybe<uint32_t> forcedDefaultIonWarmUpThreshold;
-  mozilla::Maybe<uint32_t> forcedDefaultIonSmallFunctionWarmUpThreshold;
   mozilla::Maybe<IonRegisterAllocator> forcedRegisterAllocator;
 
   // Spectre mitigation flags. Each mitigation has its own flag in order to
   // measure the effectiveness of each mitigation with various proof of
   // concept.
   bool spectreIndexMasking;
   bool spectreObjectMitigationsBarriers;
   bool spectreObjectMitigationsMisc;