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

Side by Side Diff: src/compiler/node-matchers.h

Issue 756643002: [turbofan] Fix lea matching. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Unit test & fix Created 6 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-lea-matching.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_COMPILER_NODE_MATCHERS_H_ 5 #ifndef V8_COMPILER_NODE_MATCHERS_H_
6 #define V8_COMPILER_NODE_MATCHERS_H_ 6 #define V8_COMPILER_NODE_MATCHERS_H_
7 7
8 #include "src/compiler/generic-node.h" 8 #include "src/compiler/generic-node.h"
9 #include "src/compiler/generic-node-inl.h" 9 #include "src/compiler/generic-node-inl.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 } else { 287 } else {
288 // (S + O) 288 // (S + O)
289 offset_ = right; 289 offset_ = right;
290 } 290 }
291 } else { 291 } else {
292 if (left->opcode() == AddMatcher::kOpcode && left->OwnedBy(node)) { 292 if (left->opcode() == AddMatcher::kOpcode && left->OwnedBy(node)) {
293 AddMatcher left_matcher(left); 293 AddMatcher left_matcher(left);
294 Node* left_left = left_matcher.left().node(); 294 Node* left_left = left_matcher.left().node();
295 Node* left_right = left_matcher.right().node(); 295 Node* left_right = left_matcher.right().node();
296 if (left_matcher.HasScaledInput() && left_left->OwnedBy(left)) { 296 if (left_matcher.HasScaledInput() && left_left->OwnedBy(left)) {
297 scaled_ = left_matcher.ScaledInput();
298 scale_exponent_ = left_matcher.ScaleExponent();
299 if (left_matcher.right().HasValue()) { 297 if (left_matcher.right().HasValue()) {
300 // ((S + C) + O) 298 // ((S + C) + O)
299 scaled_ = left_matcher.ScaledInput();
300 scale_exponent_ = left_matcher.ScaleExponent();
301 constant_ = left_right; 301 constant_ = left_right;
302 offset_ = right; 302 offset_ = right;
303 } else if (base_matcher.right().HasValue()) { 303 } else if (base_matcher.right().HasValue()) {
304 // ((S + O) + C) 304 // ((S + O) + C)
305 scaled_ = left_matcher.ScaledInput();
306 scale_exponent_ = left_matcher.ScaleExponent();
305 offset_ = left_right; 307 offset_ = left_right;
306 constant_ = right; 308 constant_ = right;
307 } else { 309 } else {
308 // (O + O) 310 // (O + O)
309 scaled_ = left; 311 scaled_ = left;
310 offset_ = right; 312 offset_ = right;
311 } 313 }
312 } else { 314 } else {
313 if (left_matcher.right().HasValue()) { 315 if (left_matcher.right().HasValue()) {
314 // ((O + C) + O) 316 // ((O + C) + O)
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 }; 379 };
378 380
379 typedef ScaledWithOffsetMatcher<Int32AddMatcher> ScaledWithOffset32Matcher; 381 typedef ScaledWithOffsetMatcher<Int32AddMatcher> ScaledWithOffset32Matcher;
380 typedef ScaledWithOffsetMatcher<Int64AddMatcher> ScaledWithOffset64Matcher; 382 typedef ScaledWithOffsetMatcher<Int64AddMatcher> ScaledWithOffset64Matcher;
381 383
382 } // namespace compiler 384 } // namespace compiler
383 } // namespace internal 385 } // namespace internal
384 } // namespace v8 386 } // namespace v8
385 387
386 #endif // V8_COMPILER_NODE_MATCHERS_H_ 388 #endif // V8_COMPILER_NODE_MATCHERS_H_
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-lea-matching.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698