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.

R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/15074005

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14615 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent eb18db3a
......@@ -2145,7 +2145,6 @@ void HGraph::FinalizeUniqueValueIds() {
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 @@ class HStackCheckEliminator BASE_EMBEDDED {
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 HInferRepresentation::Analyze() {
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 Uint32Analysis::UnmarkUnsafePhis() {
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::ComputeSafeUint32Operations() {
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 @@ bool HOptimizedGraphBuilder::BuildGraph() {
}
// 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 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
// 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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment