Bug 1493900. r=bhackett,sunfish a=dveditz
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 25 Sep 2018 12:14:11 +0200
changeset 492747 2b9a5bb5f3184071481a851c35ba1174c35d9486
parent 492746 b4edf6d224f784575ee30348e85a87f5f0242cfb
child 492748 7c790360c4a389663da69669001c4df73ab7238a
push id1815
push userffxbld-merge
push dateMon, 15 Oct 2018 10:40:45 +0000
treeherdermozilla-release@18d4c09e9378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett, sunfish, dveditz
bugs1493900
milestone63.0
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];