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

Unified Diff: src/compiler/node-matchers.h

Issue 2620293004: [turbofan] Relax limitation for using BaseWithIndexAndDisplacement for load/stores (Closed)
Patch Set: Fix some test bugs Created 3 years, 10 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/node.cc ('k') | test/unittests/compiler/node-matchers-unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/node-matchers.h
diff --git a/src/compiler/node-matchers.h b/src/compiler/node-matchers.h
index c317fdd5e7b5edd17f0fc0be056062034d47f6e1..d2bdb8bff5bdbe3ede04eefbf5fb667c0e5892f9 100644
--- a/src/compiler/node-matchers.h
+++ b/src/compiler/node-matchers.h
@@ -489,13 +489,14 @@ struct BaseWithIndexAndDisplacementMatcher {
bool power_of_two_plus_one = false;
DisplacementMode displacement_mode = kPositiveDisplacement;
int scale = 0;
- if (m.HasIndexInput() && left->OwnedBy(node)) {
+ if (m.HasIndexInput() && left->OwnedByAddressingOperand()) {
index = m.IndexInput();
scale = m.scale();
scale_expression = left;
power_of_two_plus_one = m.power_of_two_plus_one();
bool match_found = false;
- if (right->opcode() == AddMatcher::kSubOpcode && right->OwnedBy(node)) {
+ if (right->opcode() == AddMatcher::kSubOpcode &&
+ right->OwnedByAddressingOperand()) {
AddMatcher right_matcher(right);
if (right_matcher.right().HasValue()) {
// (S + (B - D))
@@ -506,7 +507,8 @@ struct BaseWithIndexAndDisplacementMatcher {
}
}
if (!match_found) {
- if (right->opcode() == AddMatcher::kAddOpcode && right->OwnedBy(node)) {
+ if (right->opcode() == AddMatcher::kAddOpcode &&
+ right->OwnedByAddressingOperand()) {
AddMatcher right_matcher(right);
if (right_matcher.right().HasValue()) {
// (S + (B + D))
@@ -526,7 +528,8 @@ struct BaseWithIndexAndDisplacementMatcher {
}
} else {
bool match_found = false;
- if (left->opcode() == AddMatcher::kSubOpcode && left->OwnedBy(node)) {
+ if (left->opcode() == AddMatcher::kSubOpcode &&
+ left->OwnedByAddressingOperand()) {
AddMatcher left_matcher(left);
Node* left_left = left_matcher.left().node();
Node* left_right = left_matcher.right().node();
@@ -551,7 +554,8 @@ struct BaseWithIndexAndDisplacementMatcher {
}
}
if (!match_found) {
- if (left->opcode() == AddMatcher::kAddOpcode && left->OwnedBy(node)) {
+ if (left->opcode() == AddMatcher::kAddOpcode &&
+ left->OwnedByAddressingOperand()) {
AddMatcher left_matcher(left);
Node* left_left = left_matcher.left().node();
Node* left_right = left_matcher.right().node();
@@ -565,13 +569,19 @@ struct BaseWithIndexAndDisplacementMatcher {
displacement = left_right;
base = right;
} else if (m.right().HasValue()) {
- // ((S + B) + D)
- index = left_matcher.IndexInput();
- scale = left_matcher.scale();
- scale_expression = left_left;
- power_of_two_plus_one = left_matcher.power_of_two_plus_one();
- base = left_right;
- displacement = right;
+ if (left->OwnedBy(node)) {
+ // ((S + B) + D)
+ index = left_matcher.IndexInput();
+ scale = left_matcher.scale();
+ scale_expression = left_left;
+ power_of_two_plus_one = left_matcher.power_of_two_plus_one();
+ base = left_right;
+ displacement = right;
+ } else {
+ // (B + D)
+ base = left;
+ displacement = right;
+ }
} else {
// (B + B)
index = left;
@@ -584,10 +594,16 @@ struct BaseWithIndexAndDisplacementMatcher {
displacement = left_right;
base = right;
} else if (m.right().HasValue()) {
- // ((B + B) + D)
- index = left_left;
- base = left_right;
- displacement = right;
+ if (left->OwnedBy(node)) {
+ // ((B + B) + D)
+ index = left_left;
+ base = left_right;
+ displacement = right;
+ } else {
+ // (B + D)
+ base = left;
+ displacement = right;
+ }
} else {
// (B + B)
index = left;
« no previous file with comments | « src/compiler/node.cc ('k') | test/unittests/compiler/node-matchers-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698