Bug 1493900. r=bhackett,sunfish a=dveditz
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 25 Sep 2018 12:14:11 +0200
changeset 481191 d596c94e62cd
parent 481190 d7a52857cd86
child 481192 dc688e0c9702
push id1804
push userjcristau@mozilla.com
push dateMon, 01 Oct 2018 10:38:02 +0000
treeherdermozilla-release@dc99e844c2af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, sunfish, dveditz
bugs1493900
milestone62.0.3
Bug 1493900. r=bhackett,sunfish a=dveditz
js/src/jit/BacktrackingAllocator.cpp
--- a/js/src/jit/BacktrackingAllocator.cpp
+++ b/js/src/jit/BacktrackingAllocator.cpp
@@ -1924,18 +1924,26 @@ BacktrackingAllocator::resolveControlFlo
                 MOZ_ASSERT(predecessor->mir()->numSuccessors() == 1);
 
                 LAllocation* input = phi->getOperand(k);
                 LiveRange* from = vreg(input).rangeFor(exitOf(predecessor), /* preferRegister = */ true);
                 MOZ_ASSERT(from);
 
                 if (!alloc().ensureBallast())
                     return false;
-                if (!moveAtExit(predecessor, from, to, def->type()))
-                    return false;
+                if (mSuccessor->numPredecessors() > 1) {
+                    MOZ_ASSERT(predecessor->mir()->numSuccessors() == 1);
+                    if (!moveAtExit(predecessor, from, to, def->type())) {
+                        return false;
+                    }
+                } else {
+                    if (!moveAtEntry(successor, from, to, def->type())) {
+                        return false;
+                    }
+                }
             }
         }
     }
 
     // Add moves to resolve graph edges with different allocations at their
     // source and target.
     for (size_t i = 1; i < graph.numVirtualRegisters(); i++) {
         VirtualRegister& reg = vregs[i];