Revision: 14615
Author:   [email protected]
Date:     Fri May 10 04:32:13 2013
Log:      Cleaned up Crankshaft pipeline a bit.

Two tiny changes:

* Some phases were missing an HPhase, which was added, so we can now see all
    phases in the visualizer output.

  * Consistently test commandline flags directly in the pipeline, making it
    clearer which parts are optional and which are not.

[email protected]

Review URL: https://codereview.chromium.org/15074005
http://code.google.com/p/v8/source/detail?r=14615

Modified:
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Fri May 10 02:52:08 2013
+++ /branches/bleeding_edge/src/hydrogen.cc     Fri May 10 04:32:13 2013
@@ -2145,7 +2145,6 @@


 void HGraph::Canonicalize() {
-  if (!FLAG_use_canonicalizing) return;
   HPhase phase("H_Canonicalize", this);
   for (int i = 0; i < blocks()->length(); ++i) {
     HInstruction* instr = blocks()->at(i)->first();
@@ -3148,6 +3147,7 @@


 void HStackCheckEliminator::Process() {
+  HPhase phase("H_Stack check elimination", graph_);
// For each loop block walk the dominator tree from the backwards branch to // the loop header. If a call instruction is encountered the backwards branch // is dominated by a call and the stack check in the backwards branch can be
@@ -3910,6 +3910,7 @@


 void HGraph::MergeRemovableSimulates() {
+  HPhase phase("H_Merge removable simulates", this);
   ZoneList<HSimulate*> mergelist(2, zone());
   for (int i = 0; i < blocks()->length(); ++i) {
     HBasicBlock* block = blocks()->at(i);
@@ -4413,9 +4414,8 @@


 void HGraph::ComputeSafeUint32Operations() {
-  if (!FLAG_opt_safe_uint32_operations || uint32_instructions_ == NULL) {
-    return;
-  }
+  HPhase phase("H_Compute safe UInt32 operations", this);
+  if (uint32_instructions_ == NULL) return;

   Uint32Analysis analysis(zone());
   for (int i = 0; i < uint32_instructions_->length(); ++i) {
@@ -4434,6 +4434,7 @@


 void HGraph::ComputeMinusZeroChecks() {
+  HPhase phase("H_Compute minus zero checks", this);
   BitVector visited(GetMaximumValueID(), zone());
   for (int i = 0; i < blocks_.length(); ++i) {
     for (HInstruction* current = blocks_[i]->first();
@@ -4878,19 +4879,17 @@
 }


+// Perform common subexpression elimination and loop-invariant code motion.
 void HGraph::GlobalValueNumbering() {
- // Perform common subexpression elimination and loop-invariant code motion.
-  if (FLAG_use_gvn) {
-    HPhase phase("H_Global value numbering", this);
-    HGlobalValueNumberer gvn(this, info());
-    bool removed_side_effects = gvn.Analyze();
- // Trigger a second analysis pass to further eliminate duplicate values that - // could only be discovered by removing side-effect-generating instructions
-    // during the first pass.
-    if (FLAG_smi_only_arrays && removed_side_effects) {
-      removed_side_effects = gvn.Analyze();
-      ASSERT(!removed_side_effects);
-    }
+  HPhase phase("H_Global value numbering", this);
+  HGlobalValueNumberer gvn(this, info());
+  bool removed_side_effects = gvn.Analyze();
+ // Trigger a second analysis pass to further eliminate duplicate values that + // could only be discovered by removing side-effect-generating instructions
+  // during the first pass.
+  if (FLAG_smi_only_arrays && removed_side_effects) {
+    removed_side_effects = gvn.Analyze();
+    ASSERT(!removed_side_effects);
   }
 }

@@ -4950,11 +4949,11 @@
   // Must be performed before canonicalization to ensure that Canonicalize
// will not remove semantically meaningful ToInt32 operations e.g. BIT_OR with
   // zero.
-  ComputeSafeUint32Operations();
+  if (FLAG_opt_safe_uint32_operations) ComputeSafeUint32Operations();

-  Canonicalize();
+  if (FLAG_use_canonicalizing) Canonicalize();

-  GlobalValueNumbering();
+  if (FLAG_use_gvn) GlobalValueNumbering();

   if (FLAG_use_range) {
     HRangeAnalysis rangeAnalysis(this);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to