| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index acdd545f0371092679fc719060c1072e02a9866c..f34934c85a14ba35aabc93d0b21485c62f8686ed 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -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);
|
|
|