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

Unified Diff: src/compiler/redundancy-elimination.cc

Issue 2112463002: [turbofan] Fix non-termination in RedundancyElimination. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/compiler/redundancy-elimination.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/redundancy-elimination.cc
diff --git a/src/compiler/redundancy-elimination.cc b/src/compiler/redundancy-elimination.cc
index c718bf88fc413650a7a84b4ce274163e20dad7b0..e41da45c18826fcf8c065905adb425e181408c05 100644
--- a/src/compiler/redundancy-elimination.cc
+++ b/src/compiler/redundancy-elimination.cc
@@ -55,6 +55,19 @@ RedundancyElimination::EffectPathChecks::Empty(Zone* zone) {
return new (zone->New(sizeof(EffectPathChecks))) EffectPathChecks(nullptr, 0);
}
+bool RedundancyElimination::EffectPathChecks::Equals(
+ EffectPathChecks const* that) const {
+ if (this->size_ != that->size_) return false;
+ Check* this_head = this->head_;
+ Check* that_head = that->head_;
+ while (this_head != that_head) {
+ if (this_head->node != that_head->node) return false;
+ this_head = this_head->next;
+ that_head = that_head->next;
+ }
+ return true;
+}
+
void RedundancyElimination::EffectPathChecks::Merge(
EffectPathChecks const* that) {
// Change the current check list to a longest common tail of this check
@@ -207,8 +220,10 @@ Reduction RedundancyElimination::UpdateChecks(Node* node,
// Only signal that the {node} has Changed, if the information about {checks}
// has changed wrt. the {original}.
if (checks != original) {
- node_checks_.Set(node, checks);
- return Changed(node);
+ if (original == nullptr || !checks->Equals(original)) {
+ node_checks_.Set(node, checks);
+ return Changed(node);
+ }
}
return NoChange();
}
« no previous file with comments | « src/compiler/redundancy-elimination.h ('k') | test/cctest/cctest.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698