Bug 1029830 - IonMonkey: GVN: Include the current block in GVN's spew output r=nbp
authorDan Gohman <sunfish@mozilla.com>
Wed, 17 Sep 2014 10:27:25 -0700
changeset 205886 6e9a69bead52911e66eb586184c558259a344caa
parent 205885 d123ad5677f6be76ba98550876451b743a086de1
child 205887 ff831540e312febfe640805f1cdc207ad8530185
push id27507
push userryanvm@gmail.com
push dateThu, 18 Sep 2014 02:16:54 +0000
treeherdermozilla-central@488d490da742 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnbp
bugs1029830
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1029830 - IonMonkey: GVN: Include the current block in GVN's spew output r=nbp
js/src/jit/ValueNumbering.cpp
--- a/js/src/jit/ValueNumbering.cpp
+++ b/js/src/jit/ValueNumbering.cpp
@@ -275,17 +275,17 @@ ValueNumberer::releaseInsOperands(MInstr
     return true;
 }
 
 // Discard |def| and mine its operands for any subsequently dead defs.
 bool
 ValueNumberer::discardDef(MDefinition *def,
                          UseRemovedOption useRemovedOption)
 {
-    JitSpew(JitSpew_GVN, "    Discarding %s%u", def->opName(), def->id());
+    JitSpew(JitSpew_GVN, "      Discarding %s%u", def->opName(), def->id());
     MOZ_ASSERT(IsDead(def), "Discarding non-dead definition");
     MOZ_ASSERT(!values_.has(def), "Discarding an instruction still in the set");
 
     if (def->isPhi()) {
         MPhi *phi = def->toPhi();
         MBasicBlock *phiBlock = phi->block();
         if (!releasePhiOperands(phi, phiBlock, useRemovedOption))
              return false;
@@ -318,21 +318,21 @@ ValueNumberer::processDeadDefs()
 bool
 ValueNumberer::removePredecessor(MBasicBlock *block, MBasicBlock *pred)
 {
     bool isUnreachableLoop = false;
     if (block->isLoopHeader()) {
         if (block->loopPredecessor() == pred) {
             // Discarding the entry into the loop makes the loop unreachable.
             isUnreachableLoop = true;
-            JitSpew(JitSpew_GVN, "    Loop with header block%u is no longer reachable",
+            JitSpew(JitSpew_GVN, "      Loop with header block%u is no longer reachable",
                     block->id());
 #ifdef DEBUG
         } else if (block->hasUniqueBackedge() && block->backedge() == pred) {
-            JitSpew(JitSpew_GVN, "    Loop with header block%u is no longer a loop",
+            JitSpew(JitSpew_GVN, "      Loop with header block%u is no longer a loop",
                     block->id());
 #endif
         }
     }
 
     // TODO: Removing a predecessor removes operands from phis, and these
     // operands may become dead. We should detect this and discard them. In
     // practice though, when this happens, we often end up re-running GVN for
@@ -477,38 +477,38 @@ ValueNumberer::loopHasOptimizablePhi(MBa
 // Visit |def|.
 bool
 ValueNumberer::visitDefinition(MDefinition *def)
 {
     // If this instruction has a dependency() into an unreachable block, we'll
     // need to update AliasAnalysis.
     const MDefinition *dep = def->dependency();
     if (dep != nullptr && dep->block()->isDead()) {
-        JitSpew(JitSpew_GVN, "    AliasAnalysis invalidated");
+        JitSpew(JitSpew_GVN, "      AliasAnalysis invalidated");
         if (updateAliasAnalysis_ && !dependenciesBroken_) {
             // TODO: Recomputing alias-analysis could theoretically expose more
             // GVN opportunities.
-            JitSpew(JitSpew_GVN, "      Will recompute!");
+            JitSpew(JitSpew_GVN, "        Will recompute!");
             dependenciesBroken_ = true;
         }
         // Clear its dependency for now, to protect foldsTo.
         def->setDependency(def->toInstruction());
     }
 
     // Look for a simplified form of |def|.
     MDefinition *sim = simplified(def);
     if (sim != def) {
         if (sim == nullptr)
             return false;
 
         // If |sim| doesn't belong to a block, insert it next to |def|.
         if (sim->block() == nullptr)
             def->block()->insertAfter(def->toInstruction(), sim->toInstruction());
 
-        JitSpew(JitSpew_GVN, "    Folded %s%u to %s%u",
+        JitSpew(JitSpew_GVN, "      Folded %s%u to %s%u",
                 def->opName(), def->id(), sim->opName(), sim->id());
         ReplaceAllUsesWith(def, sim);
 
         // The node's foldsTo said |def| can be replaced by |rep|. If |def| is a
         // guard, then either |rep| is also a guard, or a guard isn't actually
         // needed, so we can clear |def|'s guard flag and let it be discarded.
         def->setNotGuardUnchecked();
 
@@ -521,17 +521,17 @@ ValueNumberer::visitDefinition(MDefiniti
 
     // Look for a dominating def which makes |def| redundant.
     MDefinition *rep = leader(def);
     if (rep != def) {
         if (rep == nullptr)
             return false;
         if (rep->updateForReplacement(def)) {
             JitSpew(JitSpew_GVN,
-                    "    Replacing %s%u with %s%u",
+                    "      Replacing %s%u with %s%u",
                     def->opName(), def->id(), rep->opName(), rep->id());
             ReplaceAllUsesWith(def, rep);
 
             // The node's congruentTo said |def| is congruent to |rep|, and it's
             // dominated by |rep|. If |def| is a guard, it's covered by |rep|,
             // so we can clear |def|'s guard flag and let it be discarded.
             def->setNotGuardUnchecked();
 
@@ -562,17 +562,17 @@ ValueNumberer::visitControlInstruction(M
         return true;
 
     if (rep == nullptr)
         return false;
 
     MControlInstruction *newControl = rep->toControlInstruction();
     MOZ_ASSERT(!newControl->block(),
                "Control instruction replacement shouldn't already be in a block");
-    JitSpew(JitSpew_GVN, "    Folded control instruction %s%u to %s%u",
+    JitSpew(JitSpew_GVN, "      Folded control instruction %s%u to %s%u",
             control->opName(), control->id(), newControl->opName(), graph_.getNumInstructionIds());
 
     // If the simplification removes any CFG edges, update the CFG and remove
     // any blocks that become dead.
     size_t oldNumSuccs = control->numSuccessors();
     size_t newNumSuccs = newControl->numSuccessors();
     if (newNumSuccs != oldNumSuccs) {
         MOZ_ASSERT(newNumSuccs < oldNumSuccs, "New control instruction has too many successors");
@@ -599,16 +599,18 @@ ValueNumberer::visitControlInstruction(M
 
 // Visit all the phis and instructions |block|.
 bool
 ValueNumberer::visitBlock(MBasicBlock *block, const MBasicBlock *dominatorRoot)
 {
     MOZ_ASSERT(!block->unreachable(), "Blocks marked unreachable during GVN");
     MOZ_ASSERT(!block->isDead(), "Block to visit is already dead");
 
+    JitSpew(JitSpew_GVN, "    Visiting block%u", block->id());
+
     // Visit the definitions in the block top-down.
     for (MDefinitionIterator iter(block); iter; ) {
         MDefinition *def = *iter++;
 
         // If the definition is dead, discard it.
         if (IsDead(def)) {
             if (!discardDefsRecursively(def))
                 return false;