Bug 1511538 - Check implicitly used flags when flagging phis for removed uses. r=jandem, a=RyanVM
authorNicolas B. Pierron <nicolas.b.pierron@nbp.name>
Wed, 09 Jan 2019 21:27:50 -0500
changeset 509389 947bc1c824fee0e098660f656f77df59c3225abe
parent 509388 6f5097891fe3767390f102f671f349a97568b438
child 509390 c4bda79261ba60e22768197f8219d7061e066227
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, RyanVM
bugs1511538
milestone65.0
Bug 1511538 - Check implicitly used flags when flagging phis for removed uses. r=jandem, a=RyanVM
js/src/jit/IonAnalysis.cpp
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -90,17 +90,18 @@ static bool DepthFirstSearchUse(MIRGener
 
       MDefinition* cdef = consumer->toDefinition();
       if (!cdef->isPhi()) {
         // The producer is explicitly used by a definition.
         return push(producer, use);
       }
 
       MPhi* cphi = cdef->toPhi();
-      if (cphi->getUsageAnalysis() == PhiUsage::Used || cphi->isUseRemoved()) {
+      if (cphi->getUsageAnalysis() == PhiUsage::Used || cphi->isUseRemoved() ||
+          cphi->isImplicitlyUsed()) {
         // The information got cached on the Phi the last time it
         // got visited, or when flagging operands of removed
         // instructions.
         return push(producer, use);
       }
 
       if (cphi->isInWorklist() || cphi == producer) {
         // We are already iterating over the uses of this Phi
@@ -220,17 +221,18 @@ static bool FlagPhiInputsAsHavingRemoved
     // between the |block| and its successor |succ|.
     MDefinition* def = phi->getOperand(predIndex);
     if (def->isUseRemoved()) {
       continue;
     }
 
     // If the Phi is either Used or Unused, set the UseRemoved flag
     // accordingly.
-    if (phi->getUsageAnalysis() == PhiUsage::Used || phi->isUseRemoved()) {
+    if (phi->getUsageAnalysis() == PhiUsage::Used || phi->isUseRemoved() ||
+        phi->isImplicitlyUsed()) {
       def->setUseRemoved();
       continue;
     } else if (phi->getUsageAnalysis() == PhiUsage::Unused) {
       continue;
     }
 
     // We do not know if the Phi was Used or Unused, iterate over all uses
     // with a depth-search of uses. Returns the matching stack in the