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

Unified Diff: src/compiler/load-elimination.cc

Issue 2108793003: [turbofan] Drop the obsolete TypeGuard operator. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@MathRandom
Patch Set: Created 4 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/js-intrinsic-lowering.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/load-elimination.cc
diff --git a/src/compiler/load-elimination.cc b/src/compiler/load-elimination.cc
index 0f9809ea3af895f5001c75bb6b6b13c6eb7310f4..e82b39567eb4df64c1fcf4d44d79177e4d1c102b 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -61,21 +61,20 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
NodeProperties::GetValueInput(effect, 0));
if (object == value_input) {
Node* const value = NodeProperties::GetValueInput(effect, 1);
- Type* stored_value_type = NodeProperties::GetType(value);
- Type* load_type = NodeProperties::GetType(node);
+ Type* value_type = NodeProperties::GetType(value);
+ Type* node_type = NodeProperties::GetType(node);
// Make sure the replacement's type is a subtype of the node's
// type. Otherwise we could confuse optimizations that were
// based on the original type.
- if (stored_value_type->Is(load_type)) {
+ if (value_type->Is(node_type)) {
ReplaceWithValue(node, value);
return Replace(value);
} else {
- Node* renamed = graph()->NewNode(
- simplified()->TypeGuard(Type::Intersect(
- stored_value_type, load_type, graph()->zone())),
- value, NodeProperties::GetControlInput(node));
- ReplaceWithValue(node, renamed);
- return Replace(renamed);
+ // This LoadField has stronger guarantees than the stored value
+ // can give us, which suggests that we are probably in unreachable
+ // code, guarded by some Check, so don't bother trying to optimize
+ // this LoadField {node}.
+ return NoChange();
}
}
// TODO(turbofan): Alias analysis to the rescue?
« no previous file with comments | « src/compiler/js-intrinsic-lowering.cc ('k') | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698