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

Unified Diff: src/compiler/machine-operator-reducer.cc

Issue 1921673003: [turbofan] Elide mask for CheckedStore (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/machine-operator-reducer.cc
diff --git a/src/compiler/machine-operator-reducer.cc b/src/compiler/machine-operator-reducer.cc
index 7271503d46fdcc4f363d0de135e8cc43b636a876..4b50ffe61ea46c67bd5ae376de040c4123ec9eb3 100644
--- a/src/compiler/machine-operator-reducer.cc
+++ b/src/compiler/machine-operator-reducer.cc
@@ -448,6 +448,7 @@ Reduction MachineOperatorReducer::Reduce(Node* node) {
case IrOpcode::kFloat64InsertHighWord32:
return ReduceFloat64InsertHighWord32(node);
case IrOpcode::kStore:
+ case IrOpcode::kCheckedStore:
return ReduceStore(node);
case IrOpcode::kFloat64Equal:
case IrOpcode::kFloat64LessThan:
@@ -656,9 +657,19 @@ Reduction MachineOperatorReducer::ReduceUint32Mod(Node* node) {
Reduction MachineOperatorReducer::ReduceStore(Node* node) {
- MachineRepresentation const rep =
- StoreRepresentationOf(node->op()).representation();
- Node* const value = node->InputAt(2);
+ NodeMatcher nm(node);
+ MachineRepresentation rep;
+ int value_input;
+ if (nm.IsCheckedStore()) {
+ rep = CheckedStoreRepresentationOf(node->op());
+ value_input = 3;
+ } else {
+ rep = StoreRepresentationOf(node->op()).representation();
+ value_input = 2;
+ }
+
+ Node* const value = node->InputAt(value_input);
+
switch (value->opcode()) {
case IrOpcode::kWord32And: {
Uint32BinopMatcher m(value);
@@ -666,7 +677,7 @@ Reduction MachineOperatorReducer::ReduceStore(Node* node) {
(m.right().Value() & 0xff) == 0xff) ||
(rep == MachineRepresentation::kWord16 &&
(m.right().Value() & 0xffff) == 0xffff))) {
- node->ReplaceInput(2, m.left().node());
+ node->ReplaceInput(value_input, m.left().node());
return Changed(node);
}
break;
@@ -679,7 +690,7 @@ Reduction MachineOperatorReducer::ReduceStore(Node* node) {
m.right().IsInRange(1, 16)))) {
Int32BinopMatcher mleft(m.left().node());
if (mleft.right().Is(m.right().Value())) {
- node->ReplaceInput(2, mleft.left().node());
+ node->ReplaceInput(value_input, mleft.left().node());
return Changed(node);
}
}
« 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