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

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

Issue 2336093002: [turbofan] Strength reduce CheckTaggedSigned/Pointer with checked inputs. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « no previous file | test/unittests/compiler/simplified-operator-reducer-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/simplified-operator-reducer.h" 5 #include "src/compiler/simplified-operator-reducer.h"
6 6
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/machine-operator.h" 8 #include "src/compiler/machine-operator.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/operator-properties.h" 10 #include "src/compiler/operator-properties.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 return Changed(node); 141 return Changed(node);
142 } 142 }
143 break; 143 break;
144 } 144 }
145 case IrOpcode::kCheckTaggedPointer: { 145 case IrOpcode::kCheckTaggedPointer: {
146 Node* const input = node->InputAt(0); 146 Node* const input = node->InputAt(0);
147 if (DecideObjectIsSmi(input) == Decision::kFalse) { 147 if (DecideObjectIsSmi(input) == Decision::kFalse) {
148 ReplaceWithValue(node, input); 148 ReplaceWithValue(node, input);
149 return Replace(input); 149 return Replace(input);
150 } 150 }
151 NodeMatcher m(input);
152 if (m.IsCheckTaggedPointer()) {
153 ReplaceWithValue(node, input);
154 return Replace(input);
155 }
151 break; 156 break;
152 } 157 }
153 case IrOpcode::kCheckTaggedSigned: { 158 case IrOpcode::kCheckTaggedSigned: {
154 Node* const input = node->InputAt(0); 159 Node* const input = node->InputAt(0);
155 if (DecideObjectIsSmi(input) == Decision::kTrue) { 160 if (DecideObjectIsSmi(input) == Decision::kTrue) {
156 ReplaceWithValue(node, input); 161 ReplaceWithValue(node, input);
157 return Replace(input); 162 return Replace(input);
158 } 163 }
159 NodeMatcher m(input); 164 NodeMatcher m(input);
160 if (m.IsConvertTaggedHoleToUndefined()) { 165 if (m.IsCheckTaggedSigned()) {
166 ReplaceWithValue(node, input);
167 return Replace(input);
168 } else if (m.IsConvertTaggedHoleToUndefined()) {
161 node->ReplaceInput(0, m.InputAt(0)); 169 node->ReplaceInput(0, m.InputAt(0));
162 return Changed(node); 170 return Changed(node);
163 } 171 }
164 break; 172 break;
165 } 173 }
166 case IrOpcode::kObjectIsSmi: { 174 case IrOpcode::kObjectIsSmi: {
167 Node* const input = node->InputAt(0); 175 Node* const input = node->InputAt(0);
168 switch (DecideObjectIsSmi(input)) { 176 switch (DecideObjectIsSmi(input)) {
169 case Decision::kTrue: 177 case Decision::kTrue:
170 return ReplaceBoolean(true); 178 return ReplaceBoolean(true);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 return jsgraph()->isolate(); 241 return jsgraph()->isolate();
234 } 242 }
235 243
236 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const { 244 MachineOperatorBuilder* SimplifiedOperatorReducer::machine() const {
237 return jsgraph()->machine(); 245 return jsgraph()->machine();
238 } 246 }
239 247
240 } // namespace compiler 248 } // namespace compiler
241 } // namespace internal 249 } // namespace internal
242 } // namespace v8 250 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/unittests/compiler/simplified-operator-reducer-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698