| 898 | } |
| 899 | |
| 900 | Status DeadnessAnalysisImpl::GetInputPreds( |
| 901 | Node* n, DeadnessAnalysisImpl::EdgeKind edge_kind, |
| 902 | std::vector<Predicate*>* result) { |
| 903 | result->clear(); |
| 904 | for (const Edge* in_edge : n->in_edges()) { |
| 905 | bool should_process = |
| 906 | edge_kind == EdgeKind::kDataAndControl || |
| 907 | (in_edge->IsControlEdge() && edge_kind == EdgeKind::kControlOnly) || |
| 908 | (!in_edge->IsControlEdge() && edge_kind == EdgeKind::kDataOnly); |
| 909 | |
| 910 | if (should_process) { |
| 911 | auto it = predicate_map_.find(InputEdgeToTensorId(in_edge)); |
| 912 | if (it == predicate_map_.end()) { |
| 913 | GraphCycles graph_cycles; |
| 914 | TF_RETURN_IF_ERROR( |
| 915 | CreateCycleDetectionGraph(&graph_, &graph_cycles).status()); |
| 916 | |
| 917 | // If we didn't return with an error above then the graph is probably |
| 918 | // fine and we have a bug in deadness analysis. |
| 919 | return errors::Internal("Could not find input ", in_edge->DebugString(), |
| 920 | " to ", n->name(), |
| 921 | " when visiting the graph in post-order. Most " |
| 922 | "likely indicates a bug in deadness analysis."); |
| 923 | } |
| 924 | result->push_back(it->second); |
| 925 | } |
| 926 | } |
| 927 | return Status::OK(); |
| 928 | } |
| 929 | |
| 930 | Status DeadnessAnalysisImpl::HandleSwitch(Node* n, |
| 931 | std::vector<bool>* should_revisit) { |
nothing calls this directly
no test coverage detected