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

Side by Side Diff: src/compiler/machine-operator-reducer.cc

Issue 642033002: [turbofan] Eliminate redundant masking operations for word8/word16 stores. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comment. Created 6 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | test/unittests/compiler/change-lowering-unittest.cc » ('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 #include "src/compiler/machine-operator-reducer.h" 5 #include "src/compiler/machine-operator-reducer.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/codegen.h" 8 #include "src/codegen.h"
9 #include "src/compiler/generic-node-inl.h" 9 #include "src/compiler/generic-node-inl.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 if (m.HasValue()) return ReplaceInt32(static_cast<int32_t>(m.Value())); 466 if (m.HasValue()) return ReplaceInt32(static_cast<int32_t>(m.Value()));
467 if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0)); 467 if (m.IsChangeInt32ToInt64()) return Replace(m.node()->InputAt(0));
468 break; 468 break;
469 } 469 }
470 case IrOpcode::kTruncateFloat64ToFloat32: { 470 case IrOpcode::kTruncateFloat64ToFloat32: {
471 Float64Matcher m(node->InputAt(0)); 471 Float64Matcher m(node->InputAt(0));
472 if (m.HasValue()) return ReplaceFloat32(DoubleToFloat32(m.Value())); 472 if (m.HasValue()) return ReplaceFloat32(DoubleToFloat32(m.Value()));
473 if (m.IsChangeFloat32ToFloat64()) return Replace(m.node()->InputAt(0)); 473 if (m.IsChangeFloat32ToFloat64()) return Replace(m.node()->InputAt(0));
474 break; 474 break;
475 } 475 }
476 case IrOpcode::kStore: {
477 Node* const value = node->InputAt(2);
478 // TODO(turbofan): Extend to 64-bit?
479 if (value->opcode() == IrOpcode::kWord32And) {
480 MachineType const rep = static_cast<MachineType>(
481 StoreRepresentationOf(node->op()).machine_type() & kRepMask);
482 Uint32BinopMatcher m(value);
483 if (m.right().HasValue() &&
484 ((rep == kRepWord8 && (m.right().Value() & 0xff) == 0xff) ||
485 (rep == kRepWord16 && (m.right().Value() & 0xffff) == 0xffff))) {
486 node->ReplaceInput(2, m.left().node());
487 return Changed(node);
488 }
489 }
490 break;
491 }
476 default: 492 default:
477 break; 493 break;
478 } 494 }
479 return NoChange(); 495 return NoChange();
480 } 496 }
481 497
482 498
483 Reduction MachineOperatorReducer::ReduceProjection(size_t index, Node* node) { 499 Reduction MachineOperatorReducer::ReduceProjection(size_t index, Node* node) {
484 switch (node->opcode()) { 500 switch (node->opcode()) {
485 case IrOpcode::kInt32AddWithOverflow: { 501 case IrOpcode::kInt32AddWithOverflow: {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 MachineOperatorBuilder* MachineOperatorReducer::machine() const { 541 MachineOperatorBuilder* MachineOperatorReducer::machine() const {
526 return jsgraph()->machine(); 542 return jsgraph()->machine();
527 } 543 }
528 544
529 545
530 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); } 546 Graph* MachineOperatorReducer::graph() const { return jsgraph()->graph(); }
531 547
532 } // namespace compiler 548 } // namespace compiler
533 } // namespace internal 549 } // namespace internal
534 } // namespace v8 550 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/machine-operator.cc ('k') | test/unittests/compiler/change-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698