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

Side by Side Diff: src/compiler/instruction-selector.cc

Issue 738073002: [turbofan]: More optimizations to add and subtract operations on x64 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tests Created 6 years, 1 month 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 | « src/compiler/instruction-selector.h ('k') | src/compiler/x64/code-generator-x64.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/instruction-selector.h" 5 #include "src/compiler/instruction-selector.h"
6 6
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/instruction-selector-impl.h" 8 #include "src/compiler/instruction-selector-impl.h"
9 #include "src/compiler/node-matchers.h" 9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties-inl.h" 10 #include "src/compiler/node-properties-inl.h"
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 instructions_.push_back(instr); 147 instructions_.push_back(instr);
148 return instr; 148 return instr;
149 } 149 }
150 150
151 151
152 bool InstructionSelector::IsNextInAssemblyOrder(const BasicBlock* block) const { 152 bool InstructionSelector::IsNextInAssemblyOrder(const BasicBlock* block) const {
153 return current_block_->GetAoNumber().IsNext(block->GetAoNumber()); 153 return current_block_->GetAoNumber().IsNext(block->GetAoNumber());
154 } 154 }
155 155
156 156
157 bool InstructionSelector::ValueOwnedBy(Node* owner, Node* value) const {
titzer 2014/11/20 12:39:24 Maybe we can move this to a more generic location
danno 2014/11/20 13:43:07 As discussed, the new patch set uses IsLive rather
158 Node::Uses uses = value->uses();
159 bool found_use = false;
160 for (Node::Uses::iterator current = uses.begin(); current != uses.end();
titzer 2014/11/20 12:39:24 You can use a C++ foreach here now!
161 ++current) {
162 Node* use = *current;
163 if (use == owner) {
164 found_use = true;
165 } else if (!NodeProperties::IsEffectEdge(current.edge())) {
166 return false;
167 }
168 }
169 return found_use;
170 }
171
172
157 bool InstructionSelector::CanCover(Node* user, Node* node) const { 173 bool InstructionSelector::CanCover(Node* user, Node* node) const {
158 return node->OwnedBy(user) && 174 return node->OwnedBy(user) &&
159 schedule()->block(node) == schedule()->block(user); 175 schedule()->block(node) == schedule()->block(user);
160 } 176 }
161 177
162 178
163 int InstructionSelector::GetVirtualRegister(const Node* node) { 179 int InstructionSelector::GetVirtualRegister(const Node* node) {
164 if (node_map_[node->id()] == kNodeUnmapped) { 180 if (node_map_[node->id()] == kNodeUnmapped) {
165 node_map_[node->id()] = sequence()->NextVirtualRegister(); 181 node_map_[node->id()] = sequence()->NextVirtualRegister();
166 } 182 }
(...skipping 947 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 MachineOperatorBuilder::Flags 1130 MachineOperatorBuilder::Flags
1115 InstructionSelector::SupportedMachineOperatorFlags() { 1131 InstructionSelector::SupportedMachineOperatorFlags() {
1116 return MachineOperatorBuilder::Flag::kNoFlags; 1132 return MachineOperatorBuilder::Flag::kNoFlags;
1117 } 1133 }
1118 1134
1119 #endif // !V8_TURBOFAN_BACKEND 1135 #endif // !V8_TURBOFAN_BACKEND
1120 1136
1121 } // namespace compiler 1137 } // namespace compiler
1122 } // namespace internal 1138 } // namespace internal
1123 } // namespace v8 1139 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/instruction-selector.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698