Bug 995542: Add extra consumers of the congruence-head when we split it from the class. (r=sstangl)
authorMarty Rosenberg <mrosenberg@mozilla.com>
Tue, 22 Apr 2014 15:11:36 -0400
changeset 179963 5ea518e77780c438e518f01c1062c4b4c4f79caf
parent 179962 72661e0787418f3652200dc6c930947ad13f49dc
child 179964 d4df499022c99c391dc2d1c2a0289d492357170e
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerssstangl
bugs995542
milestone31.0a1
Bug 995542: Add extra consumers of the congruence-head when we split it from the class. (r=sstangl)
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