Index: src/compiler/loop-analysis.cc |
diff --git a/src/compiler/loop-analysis.cc b/src/compiler/loop-analysis.cc |
index 2a1487136971530e78f88aa43741f7b2a3afbe5a..17e4fd40aef535c78b59207fc9d1563fd82bfb75 100644 |
--- a/src/compiler/loop-analysis.cc |
+++ b/src/compiler/loop-analysis.cc |
@@ -462,6 +462,16 @@ LoopTree* LoopFinder::BuildLoopTree(Graph* graph, Zone* zone) { |
return loop_tree; |
} |
+ |
+Node* LoopTree::HeaderNode(Loop* loop) { |
+ Node* first = *HeaderNodes(loop).begin(); |
+ if (first->opcode() == IrOpcode::kLoop) return first; |
+ DCHECK(IrOpcode::IsPhiOpcode(first->opcode())); |
+ Node* header = NodeProperties::GetControlInput(first); |
+ DCHECK_EQ(IrOpcode::kLoop, header->opcode()); |
+ return header; |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |