message: Validate the control flow information after subgraph rewrite, since the rewrite may remove some special nodes (e.g. TPUReplicateMetadata) which break the rule.
diff: @@ -1109,6 +1109,9 @@ Status Encapsulator::Subgraph::BuildFunctionDef(
  function_def_name_ = name;
  FunctionDef fdef;
  + // Verify that the graph has well-formed control flow structure.
  + std::vector<ControlFlowInfo> dummy;
  + TF_RETURN_IF_ERROR(BuildControlFlowInfo(graph_.get(), &dummy));
  TF_RETURN_IF_ERROR(GraphToFunctionDef(*graph_, name, &fdef));
  if (VLOG_IS_ON(1)) {
  @@ -1531,9 +1534,6 @@ Status Encapsulator::SplitIntoSubgraphs(FunctionLibraryDefinition* library) {
  for (auto& entry : subgraphs_) {
  Subgraph& subgraph = entry.second;
  FixupSourceAndSinkEdges(subgraph.GetGraph());
  - // Verify that the graph has well-formed control flow structure.
  - std::vector<ControlFlowInfo> dummy;
  - TF_RETURN_IF_ERROR(BuildControlFlowInfo(subgraph.GetGraph(), &dummy));
  }
  if (VLOG_IS_ON(1)) {
  