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 2104893002: [compiler] Load elimination now traverses CheckTaggedPointer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@p7-base
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 | « 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/load-elimination.cc
diff --git a/src/compiler/load-elimination.cc b/src/compiler/load-elimination.cc
index a451cfce732d18d7a25aaec7234474cbdb57157d..0f9809ea3af895f5001c75bb6b6b13c6eb7310f4 100644
--- a/src/compiler/load-elimination.cc
+++ b/src/compiler/load-elimination.cc
@@ -25,6 +25,19 @@ Reduction LoadElimination::Reduce(Node* node) {
return NoChange();
}
+namespace {
+
+// If {node} is a CheckTaggedPointer, follow its input until {node} is no
+// longer a CheckTaggedPointer.
+Node* NormalizeCheckTaggedPointer(Node* node) {
+ while (node->opcode() == IrOpcode::kCheckTaggedPointer) {
+ node = NodeProperties::GetValueInput(node, 0);
+ }
+ return node;
+}
+
+} // namespace
+
Reduction LoadElimination::ReduceLoadField(Node* node) {
DCHECK_EQ(IrOpcode::kLoadField, node->opcode());
FieldAccess const access = FieldAccessOf(node->op());
@@ -44,7 +57,9 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
}
case IrOpcode::kStoreField: {
if (access == FieldAccessOf(effect->op())) {
- if (object == NodeProperties::GetValueInput(effect, 0)) {
+ Node* value_input = NormalizeCheckTaggedPointer(
+ 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);
@@ -74,7 +89,8 @@ Reduction LoadElimination::ReduceLoadField(Node* node) {
// These can never interfere with field loads.
break;
}
- case IrOpcode::kFinishRegion: {
+ case IrOpcode::kFinishRegion:
+ case IrOpcode::kCheckTaggedPointer: {
// "Look through" FinishRegion nodes to make LoadElimination capable
// of looking into atomic regions.
if (object == effect) object = NodeProperties::GetValueInput(effect, 0);
« 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