| 354 | } |
| 355 | |
| 356 | bool CallGraph::IsFlattened() const { |
| 357 | for (const CallGraphNode& node : nodes_) { |
| 358 | if (node.context() == CallContext::kBoth) { |
| 359 | return false; |
| 360 | } |
| 361 | if (node.context() == CallContext::kSequential && |
| 362 | node.caller_callsites().size() > 1) { |
| 363 | return false; |
| 364 | } |
| 365 | } |
| 366 | return true; |
| 367 | } |
| 368 | |
| 369 | std::vector<HloInstruction*> CallGraph::GetComputationCallers( |
| 370 | HloComputation* c) { |