Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Unified Diff: src/hydrogen.cc

Issue 17657004: Refactor Hydrogen GVN into an HPhase and use the phase zone. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Correct CL Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-gvn.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 10d78bc964ce72e0f3de10883f9ef266456ea21c..0e6e8681279f4075a4a74430f8a9d759ce775734 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -3946,21 +3946,6 @@ bool HOptimizedGraphBuilder::BuildGraph() {
}
-// Perform common subexpression elimination and loop-invariant code motion.
-void HGraph::GlobalValueNumbering() {
- 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);
- }
-}
-
-
bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
*bailout_reason = SmartArrayPointer<char>();
OrderBlocks();
@@ -4029,7 +4014,10 @@ bool HGraph::Optimize(SmartArrayPointer<char>* bailout_reason) {
if (FLAG_use_canonicalizing) Canonicalize();
- if (FLAG_use_gvn) GlobalValueNumbering();
+ if (FLAG_use_gvn) {
+ HGlobalValueNumberingPhase phase(this);
+ phase.Run();
+ }
if (FLAG_use_range) {
HRangeAnalysis rangeAnalysis(this);
« no previous file with comments | « src/hydrogen.h ('k') | src/hydrogen-gvn.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698