Bug 1338642 - Backout bug 1315596 (Don't evict bundles which won't help with allocating the target bundle), r=sunfish.
authorBrian Hackett <bhackett1024@gmail.com>
Sat, 25 Feb 2017 05:32:59 -0700
changeset 373961 85e40ef81409ff7f4188407b160aa80a3745a7d3
parent 373960 7e6204be142a74d93a66bb17758fa9fcfe08afb6
child 373962 2dd1002e793bbce35bbd3e39e906028e4acd0107
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssunfish
bugs1338642, 1315596
milestone54.0a1
Bug 1338642 - Backout bug 1315596 (Don't evict bundles which won't help with allocating the target bundle), r=sunfish.
js/src/jit/BacktrackingAllocator.cpp
js/src/jit/BacktrackingAllocator.h
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -1384,39 +1384,16 @@ BacktrackingAllocator::computeRequiremen
                     return false;
             }
         }
     }
 
     return true;
 }
 
-// Return whether |conflicting| has any fixed uses of registers which overlap
-// with |bundle|.
-bool
-BacktrackingAllocator::hasFixedUseOverlap(LiveBundle* bundle, const LiveBundleVector& conflicting)
-{
-    for (size_t i = 0; i < conflicting.length(); i++) {
-        LiveBundle* existing = conflicting[i];
-        for (LiveRange::BundleLinkIterator iter = existing->rangesBegin(); iter; iter++) {
-            LiveRange* range = LiveRange::get(*iter);
-            if (range->hasDefinition()) {
-                LDefinition* def = vregs[range->vreg()].def();
-                if (def->policy() == LDefinition::FIXED && bundle->rangeFor(range->from()))
-                    return true;
-            }
-            for (UsePositionIterator iter(range->usesBegin()); iter; iter++) {
-                if (iter->usePolicy() == LUse::FIXED && bundle->rangeFor(iter->pos))
-                    return true;
-            }
-        }
-    }
-    return false;
-}
-
 bool
 BacktrackingAllocator::tryAllocateRegister(PhysicalRegister& r, LiveBundle* bundle,
                                            bool* success, bool* pfixed, LiveBundleVector& conflicting)
 {
     *success = false;
 
     if (!r.allocatable)
         return true;
@@ -1474,22 +1451,17 @@ BacktrackingAllocator::tryAllocateRegist
                     LiveBundle* existing = aliasedConflicting[i];
                     JitSpew(JitSpew_RegAlloc, "      %s [weight %" PRIuSIZE "]",
                             existing->toString().get(), computeSpillWeight(existing));
                 }
             }
         }
 #endif
 
-        if (hasFixedUseOverlap(bundle, aliasedConflicting)) {
-            // Ignore conflicting bundles whose eviction will not allow the
-            // bundle to be allocated.
-            JitSpew(JitSpew_RegAlloc,
-                    "  Ignoring conflict due to fixed use/def overlap with bundle");
-        } else if (conflicting.empty()) {
+        if (conflicting.empty()) {
             if (!conflicting.appendAll(aliasedConflicting))
                 return false;
         } else {
             if (maximumSpillWeight(aliasedConflicting) < maximumSpillWeight(conflicting)) {
                 conflicting.clear();
                 if (!conflicting.appendAll(aliasedConflicting))
                     return false;
             }
--- a/js/src/jit/BacktrackingAllocator.h
+++ b/js/src/jit/BacktrackingAllocator.h
@@ -710,17 +710,16 @@ class BacktrackingAllocator : protected 
     MOZ_MUST_USE bool tryAllocateFixed(LiveBundle* bundle, Requirement requirement,
                                        bool* success, bool* pfixed, LiveBundleVector& conflicting);
     MOZ_MUST_USE bool tryAllocateNonFixed(LiveBundle* bundle, Requirement requirement,
                                           Requirement hint, bool* success, bool* pfixed,
                                           LiveBundleVector& conflicting);
     MOZ_MUST_USE bool processBundle(MIRGenerator* mir, LiveBundle* bundle);
     MOZ_MUST_USE bool computeRequirement(LiveBundle* bundle, Requirement *prequirement,
                                          Requirement *phint);
-    bool hasFixedUseOverlap(LiveBundle* bundle, const LiveBundleVector& conflicting);
     MOZ_MUST_USE bool tryAllocateRegister(PhysicalRegister& r, LiveBundle* bundle, bool* success,
                                           bool* pfixed, LiveBundleVector& conflicting);
     MOZ_MUST_USE bool evictBundle(LiveBundle* bundle);
     MOZ_MUST_USE bool splitAndRequeueBundles(LiveBundle* bundle,
                                              const LiveBundleVector& newBundles);
     MOZ_MUST_USE bool spill(LiveBundle* bundle);
     MOZ_MUST_USE bool tryAllocatingRegistersForSpillBundles();