Bug 995542 - Add extra consumers of the congruence-head when we split it from the class. r=sstangl, a=sledru
authorMarty Rosenberg <mrosenberg@mozilla.com>
Tue, 22 Apr 2014 15:11:36 -0400
changeset 192291 9e2975cd6792
parent 192290 d087200dd934
child 192292 68b0fb01bfdc
push id3559
push userryanvm@gmail.com
push date2014-05-15 13:07 +0000
Treeherderresults
reviewerssstangl, sledru
bugs995542
milestone30.0
Bug 995542 - Add extra consumers of the congruence-head when we split it from the class. r=sstangl, a=sledru
js/src/jit/ValueNumbering.cpp
--- a/js/src/jit/ValueNumbering.cpp
+++ b/js/src/jit/ValueNumbering.cpp
@@ -501,16 +501,17 @@ ValueNumberer::breakClass(MDefinition *d
         // If the def was the only member of the class, then there is nothing to do.
         if (defdata->classNext == nullptr)
             return;
         // If upon closer inspection, we are still equivalent to this class
         // then there isn't anything for us to do.
         MDefinition *newRep = findSplit(def);
         if (!newRep)
             return;
+        markConsumers(def);
         ValueNumberData *newdata = newRep->valueNumberData();
 
         // Right now, |defdata| is at the front of the list, and |newdata| is
         // somewhere in the middle.
         //
         // We want to move |defdata| and everything up to but excluding
         // |newdata| to a new list, with |defdata| still as the canonical
         // element.
@@ -539,18 +540,20 @@ ValueNumberer::breakClass(MDefinition *d
         //new canonical element. Mark the remaining elements in the list
         //(including |newRep|)
         newdata->classPrev = nullptr;
         IonSpew(IonSpew_GVN, "Choosing a new representative: %d", newRep->id());
 
         // make the VN of every member in the class the VN of the new representative number.
         for (MDefinition *tmp = newRep; tmp != nullptr; tmp = tmp->valueNumberData()->classNext) {
             // if this instruction is already scheduled to be processed, don't do anything.
-            if (tmp->isInWorklist())
+            if (tmp->isInWorklist()) {
+                IonSpew(IonSpew_GVN, "Defer  to a new congruence class: %d", tmp->id());
                 continue;
+            }
             IonSpew(IonSpew_GVN, "Moving to a new congruence class: %d", tmp->id());
             tmp->setValueNumber(newRep->id());
             markConsumers(tmp);
             markDefinition(tmp);
         }
 
         // Insert the new representative => number mapping into the table
         // Logically, there should not be anything in the table currently, but