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

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

Issue 1186033006: [turbofan] Introduce DeadValue and DeadEffect operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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.cc ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/control-reducer.cc
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc
index 633dfe5abf0b31eb76b13478d43e029edbb0740b..3b91d504e894c1bf51a376a89775a44ac8244b9c 100644
--- a/src/compiler/control-reducer.cc
+++ b/src/compiler/control-reducer.cc
@@ -47,7 +47,7 @@ class ControlReducerImpl final : public AdvancedReducer {
node->opcode() == IrOpcode::kLoop) {
// If a node has only one control input and it is dead, replace with dead.
Node* control = NodeProperties::GetControlInput(node);
- if (control->opcode() == IrOpcode::kDead) {
+ if (control->opcode() == IrOpcode::kDeadControl) {
TRACE("ControlDead: #%d:%s\n", node->id(), node->op()->mnemonic());
return Replace(control);
}
@@ -138,8 +138,10 @@ class ControlReducerImpl final : public AdvancedReducer {
auto const inputs = node->inputs();
for (auto it = inputs.begin(); n > 1; --n, ++it) {
Node* input = *it;
- if (input->opcode() == IrOpcode::kDead) continue; // ignore dead inputs.
- if (input != node && input != replacement) { // non-redundant input.
+ // Ignore dead inputs.
+ if (input->opcode() == IrOpcode::kDeadControl) continue;
+ // Non-redundant input.
+ if (input != node && input != replacement) {
if (replacement != NULL) return node;
replacement = input;
}
@@ -161,7 +163,7 @@ class ControlReducerImpl final : public AdvancedReducer {
int live = 0;
for (int index = 0; index < node->InputCount(); ++index) {
// Skip dead inputs.
- if (node->InputAt(index)->opcode() == IrOpcode::kDead) continue;
+ if (node->InputAt(index)->opcode() == IrOpcode::kDeadControl) continue;
// Compact live inputs.
if (index != live) node->ReplaceInput(live, node->InputAt(index));
++live;
@@ -187,7 +189,7 @@ class ControlReducerImpl final : public AdvancedReducer {
int index = 0;
int live_index = 0;
for (Node* const input : node->inputs()) {
- if (input->opcode() != IrOpcode::kDead) {
+ if (input->opcode() != IrOpcode::kDeadControl) {
live++;
live_index = index;
}
@@ -301,7 +303,7 @@ class ControlReducerImpl final : public AdvancedReducer {
int live = 0;
for (int i = 0; i < merge->InputCount(); i++) {
// skip dead inputs.
- if (merge->InputAt(i)->opcode() == IrOpcode::kDead) continue;
+ if (merge->InputAt(i)->opcode() == IrOpcode::kDeadControl) continue;
// compact live inputs.
if (live != i) node->ReplaceInput(live, node->InputAt(i));
live++;
« no previous file with comments | « src/compiler/common-operator.cc ('k') | src/compiler/graph-visualizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698