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

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

Issue 1070003002: [turbofan] Add poor man's store elimination for storing to fields. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-operator-reducer.cc
diff --git a/src/compiler/simplified-operator-reducer.cc b/src/compiler/simplified-operator-reducer.cc
index 047d251bf3c6100fa1c8b49a21019d71ba56779b..d64a95c62ef31348675497c436d6062420b5a9d7 100644
--- a/src/compiler/simplified-operator-reducer.cc
+++ b/src/compiler/simplified-operator-reducer.cc
@@ -100,6 +100,21 @@ Reduction SimplifiedOperatorReducer::Reduce(Node* node) {
if (m.HasValue()) return ReplaceNumber(FastUI2D(m.Value()));
break;
}
+ case IrOpcode::kStoreField: {
+ // TODO(turbofan): Poor man's store elimination, remove this once we have
+ // a fully featured store elimination in place.
+ Node* const effect = node->InputAt(2);
+ if (effect->op()->Equals(node->op()) && effect->OwnedBy(node) &&
+ effect->InputAt(0) == node->InputAt(0)) {
+ // The {effect} is a store to the same field in the same object, and
+ // {node} is the only effect observer, so we can kill {effect} and
+ // instead make {node} depend on the incoming effect to {effect}.
+ node->ReplaceInput(2, effect->InputAt(2));
+ effect->Kill();
+ return Changed(node);
+ }
+ break;
+ }
default:
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698