Commit 89c9fc73 authored by bmeurer's avatar bmeurer Committed by Commit bot

[turbofan] Fix non-termination in RedundancyElimination.

A pointer comparison on the effect path states is not sufficient to
guarantee termination; we really need to check the actual nodes to
make sure we terminate properly, similar to what BranchElimination
does.

R=jarin@chromium.org
BUG=v8:5161

Review-Url: https://codereview.chromium.org/2112463002
Cr-Commit-Position: refs/heads/master@{#37389}
parent 4b76dc85
......@@ -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,9 +220,11 @@ 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) {
if (original == nullptr || !checks->Equals(original)) {
node_checks_.Set(node, checks);
return Changed(node);
}
}
return NoChange();
}
......
......@@ -29,6 +29,7 @@ class RedundancyElimination final : public AdvancedReducer {
public:
static EffectPathChecks* Copy(Zone* zone, EffectPathChecks const* checks);
static EffectPathChecks const* Empty(Zone* zone);
bool Equals(EffectPathChecks const* that) const;
void Merge(EffectPathChecks const* that);
EffectPathChecks const* AddCheck(Zone* zone, Node* node) const;
......
......@@ -123,9 +123,6 @@
'test-cpu-profiler/DeoptAtSecondLevelInlinedSource': [PASS, NO_VARIANTS],
'test-cpu-profiler/DeoptUntrackedFunction': [PASS, NO_VARIANTS],
# BUG(v8:5161): Flaky with turbofan.
'test-thread-termination/TerminateAndReenterFromThreadItself': [PASS, ['system == macos', NO_VARIANTS]],
############################################################################
# Slow tests.
'test-api/Threading1': [PASS, ['mode == debug', SLOW]],
......
......@@ -278,10 +278,6 @@
'unicodelctest': [PASS, NO_VARIANTS],
'unicodelctest-no-optimization': [PASS, NO_VARIANTS],
# BUG(v8:5161): Flaky with turbofan.
'regress/regress-201': [PASS, NO_VARIANTS],
'regress/regress-91008': [PASS, NO_VARIANTS],
############################################################################
# Ignition
......
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