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

Unified Diff: src/compiler/graph-reducer.cc

Issue 605933002: [turbofan] GraphReducer is more "fixpointish" now. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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 | « no previous file | src/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer.cc
diff --git a/src/compiler/graph-reducer.cc b/src/compiler/graph-reducer.cc
index 36a54e0491c5436cf3ad51405bf469c019b86a6d..07e8923b18cd07f634c30e8d8d7c0bf94858efb5 100644
--- a/src/compiler/graph-reducer.cc
+++ b/src/compiler/graph-reducer.cc
@@ -22,7 +22,6 @@ static bool NodeIdIsLessThan(const Node* node, NodeId id) {
void GraphReducer::ReduceNode(Node* node) {
- ZoneVector<Reducer*>::iterator skip = reducers_.end();
static const unsigned kMaxAttempts = 16;
bool reduce = true;
for (unsigned attempts = 0; attempts <= kMaxAttempts; ++attempts) {
@@ -31,17 +30,15 @@ void GraphReducer::ReduceNode(Node* node) {
int before = graph_->NodeCount();
for (ZoneVector<Reducer*>::iterator i = reducers_.begin();
i != reducers_.end(); ++i) {
- if (i == skip) continue; // Skip this reducer.
Reduction reduction = (*i)->Reduce(node);
Node* replacement = reduction.replacement();
if (replacement == NULL) {
// No change from this reducer.
} else if (replacement == node) {
// {replacement == node} represents an in-place reduction.
- // Rerun all the reducers except the current one for this node,
- // as now there may be more opportunities for reduction.
+ // Rerun all the reducers for this node, as now there may be more
+ // opportunities for reduction.
reduce = true;
- skip = i;
break;
} else {
if (node == graph_->start()) graph_->SetStart(replacement);
@@ -63,7 +60,6 @@ void GraphReducer::ReduceNode(Node* node) {
node->Kill();
}
// Rerun all the reductions on the {replacement}.
- skip = reducers_.end();
node = replacement;
reduce = true;
break;
« no previous file with comments | « no previous file | src/compiler/graph-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698