Index: src/compiler/instruction-selector.cc |
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc |
index f645d3660859e4c155d66edfc9350457134ae5ab..0c9850fbc923a6c478c2012d1f42f7f4ec4942c8 100644 |
--- a/src/compiler/instruction-selector.cc |
+++ b/src/compiler/instruction-selector.cc |
@@ -241,6 +241,20 @@ bool InstructionSelector::CanCover(Node* user, Node* node) const { |
return true; |
} |
+bool InstructionSelector::IsOnlyUserOfNodeInSameBlock(Node* user, |
+ Node* node) const { |
+ BasicBlock* bb_user = schedule()->block(user); |
+ BasicBlock* bb_node = schedule()->block(node); |
+ if (bb_user != bb_node) return false; |
+ for (Edge const edge : node->use_edges()) { |
+ Node* from = edge.from(); |
+ if ((from != user) && (schedule()->block(from) == bb_user)) { |
+ return false; |
+ } |
+ } |
+ return true; |
+} |
+ |
int InstructionSelector::GetVirtualRegister(const Node* node) { |
DCHECK_NOT_NULL(node); |
size_t const id = node->id(); |