| 1331 | } |
| 1332 | |
| 1333 | bool RemoveDeadNodes(Graph* g) { |
| 1334 | VLOG(2) << "Removing dead nodes"; |
| 1335 | std::unordered_set<const Node*> nodes; |
| 1336 | for (auto n : g->nodes()) { |
| 1337 | if (n->IsSource() || n->IsSink() || n->IsControlFlow() || |
| 1338 | n->op_def().is_stateful()) { |
| 1339 | nodes.insert(n); |
| 1340 | } |
| 1341 | } |
| 1342 | return PruneForReverseReachability(g, std::move(nodes)); |
| 1343 | } |
| 1344 | |
| 1345 | namespace { |
| 1346 | // If 'edges' contains only 1 non-control edge, returns it. Otherwise, |
no test coverage detected