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

Unified Diff: src/compiler/common-operator-reducer.cc

Issue 1206533002: [turbofan] Run DeadCodeElimination together with the advanced reducers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix test262 test failure Created 5 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/common-operator-reducer.h ('k') | src/compiler/graph-reducer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/common-operator-reducer.cc
diff --git a/src/compiler/common-operator-reducer.cc b/src/compiler/common-operator-reducer.cc
index 14bf812243ce20fbb212d75a8cfd75ce26dc1fcb..52b9ca8389e0d02c14b51d7016d387ce7aea18c4 100644
--- a/src/compiler/common-operator-reducer.cc
+++ b/src/compiler/common-operator-reducer.cc
@@ -68,21 +68,20 @@ Reduction CommonOperatorReducer::ReduceBranch(Node* node) {
Decision const decision = DecideCondition(cond);
if (decision == Decision::kUnknown) return NoChange();
Node* const control = node->InputAt(1);
- node->set_op(common()->Dead());
- node->TrimInputCount(0);
+ if (!dead_.is_set()) dead_.set(graph()->NewNode(common()->Dead()));
for (Node* const use : node->uses()) {
switch (use->opcode()) {
case IrOpcode::kIfTrue:
- Replace(use, (decision == Decision::kTrue) ? control : node);
+ Replace(use, (decision == Decision::kTrue) ? control : dead_.get());
break;
case IrOpcode::kIfFalse:
- Replace(use, (decision == Decision::kFalse) ? control : node);
+ Replace(use, (decision == Decision::kFalse) ? control : dead_.get());
break;
default:
UNREACHABLE();
}
}
- return Changed(node);
+ return Replace(dead_.get());
}
« no previous file with comments | « src/compiler/common-operator-reducer.h ('k') | src/compiler/graph-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698