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

Unified Diff: src/compiler/simplified-lowering.cc

Issue 871373010: [turbofan] Only replace nodes eagerly during simplified lowering if the types stay the same. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 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 | test/mjsunit/compiler/regress-452427.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index 074752b39954738df7e777387e089d5268f55ce2..cccc76b4358027d2cc6811d7c4859e6ed93f4274 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -1032,14 +1032,16 @@ class RepresentationSelector {
node->op()->mnemonic(), replacement->id(),
replacement->op()->mnemonic()));
}
- if (replacement->id() < count_) {
- // Replace with a previously existing node eagerly.
+ if (replacement->id() < count_ &&
+ GetInfo(replacement)->output == GetInfo(node)->output) {
+ // Replace with a previously existing node eagerly only if the type is the
+ // same.
node->ReplaceUses(replacement);
} else {
// Otherwise, we are replacing a node with a representation change.
// Such a substitution must be done after all lowering is done, because
- // new nodes do not have {NodeInfo} entries, and that would confuse
- // the representation change insertion for uses of it.
+ // changing the type could confuse the representation change
+ // insertion for uses of the node.
replacements_.push_back(node);
replacements_.push_back(replacement);
}
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-452427.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698