Index: src/compiler/instruction-selector.cc |
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc |
index 567b1c920f00ff86273dec94e4e4fb6ea5356330..9acdcc84cf38e70458cace12b8b871717f7719fa 100644 |
--- a/src/compiler/instruction-selector.cc |
+++ b/src/compiler/instruction-selector.cc |
@@ -154,6 +154,22 @@ bool InstructionSelector::IsNextInAssemblyOrder(const BasicBlock* block) const { |
} |
+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
|
+ Node::Uses uses = value->uses(); |
+ bool found_use = false; |
+ 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!
|
+ ++current) { |
+ Node* use = *current; |
+ if (use == owner) { |
+ found_use = true; |
+ } else if (!NodeProperties::IsEffectEdge(current.edge())) { |
+ return false; |
+ } |
+ } |
+ return found_use; |
+} |
+ |
+ |
bool InstructionSelector::CanCover(Node* user, Node* node) const { |
return node->OwnedBy(user) && |
schedule()->block(node) == schedule()->block(user); |