In FunctionalizeCond, cluster Merge nodes by (CondId, AncestorId, predicate).
In FunctionalizeCond, cluster Merge nodes by (CondId, AncestorId, predicate).

Original implementation cluster Merge nodes by (CondId, AncestorId), which is not enough. For the following case:
  pred1 = array_ops.placeholder(dtypes.bool, name='pred1')
  pred2 = array_ops.placeholder(dtypes.bool, name='pred2')
  cond1 = control_flow_ops.cond(pred1, ...)
  cond2 = control_flow_ops.cond(pred2, ...)
  cond3 = control_flow_ops.cond(pred1, use cond1 and cond2)
  cond4 = control_flow_ops.cond(pred2, use cond1 and cond2)

cond3 and cond4 have the same CondId (empty) and the same AncestorId ({pred1, PRED}, {merge_of_cond1, MERGE}), but they should not be merged into one "If" node (because they have different predicates).

This does not happen before cl/231844072, because back then AncestorId uses Switch node in AncestorId, and cond3/cond4 has different Switch nodes.

PiperOrigin-RevId: 232931242

jbedorf/tensorflow,arborh/tensorflow,tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jbedorf/tensorflow,arborh/tensorflow,freedomtan/tensorflow,ageron/tensorflow,ageron/tensorflow,alsrgv/tensorflow,petewarden/tensorflow,ageron/tensorflow,jhseu/tensorflow,karllessard/tensorflow,Intel-Corporation/tensorflow,alsrgv/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,karllessard/tensorflow,chemelnucfin/tensorflow,DavidNorman/tensorflow,paolodedios/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,alsrgv/tensorflow,jendap/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,xzturn/tensorflow,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jbedorf/tensorflow,freedomtan/tensorflow,ghchinoy/tensorflow,ppwwyyxx/tensorflow,theflofly/tensorflow,renyi533/tensorflow,chemelnucfin/tensorflow,annarev/tensorflow,cxxgtxy/tensorflow,kevin-coder/tensorflow-fork,ghchinoy/tensorflow,petewarden/tensorflow,ppwwyyxx/tensorflow,ageron/tensorflow,adit-chandra/tensorflow,adit-chandra/tensorflow,renyi533/tensorflow,davidzchen/tensorflow,ppwwyyxx/tensorflow,DavidNorman/tensorflow,sarvex/tensorflow,freedomtan/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,yongtang/tensorflow,adit-chandra/tensorflow,davidzchen/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,jbedorf/tensorflow,tensorflow/tensorflow-pywrap_saved_model,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,freedomtan/tensorflow,jbedorf/tensorflow,paolodedios/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,jbedorf/tensorflow,aam-at/tensorflow,jhseu/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,adit-chandra/tensorflow,renyi533/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,adit-chandra/tensorflow,aam-at/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow,Intel-Corporation/tensorflow,gautam1858/tensorflow,arborh/tensorflow,jhseu/tensorflow,kevin-coder/tensorflow-fork,ageron/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,arborh/tensorflow,chemelnucfin/tensorflow,karllessard/tensorflow,yongtang/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,jhseu/tensorflow,freedomtan/tensorflow,paolodedios/tensorflow,jbedorf/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,jendap/tensorflow,aam-at/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,arborh/tensorflow,DavidNorman/tensorflow,karllessard/tensorflow,alsrgv/tensorflow,jendap/tensorflow,ppwwyyxx/tensorflow,davidzchen/tensorflow,Intel-Corporation/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,yongtang/tensorflow,ageron/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,jendap/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,cxxgtxy/tensorflow,kevin-coder/tensorflow-fork,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,ppwwyyxx/tensorflow,annarev/tensorflow,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,theflofly/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,jbedorf/tensorflow,aldian/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,ppwwyyxx/tensorflow,cxxgtxy/tensorflow,adit-chandra/tensorflow,Intel-Corporation/tensorflow,aam-at/tensorflow,aldian/tensorflow,davidzchen/tensorflow,renyi533/tensorflow,annarev/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,petewarden/tensorflow,davidzchen/tensorflow,ghchinoy/tensorflow,chemelnucfin/tensorflow,tensorflow/tensorflow-pywrap_saved_model,jendap/tensorflow,ghchinoy/tensorflow,petewarden/tensorflow,arborh/tensorflow,paolodedios/tensorflow,kevin-coder/tensorflow-fork,tensorflow/tensorflow-experimental_link_static_libraries_once,yongtang/tensorflow,annarev/tensorflow,gautam1858/tensorflow,ghchinoy/tensorflow,arborh/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,alsrgv/tensorflow,xzturn/tensorflow,davidzchen/tensorflow,frreiss/tensorflow-fred,jhseu/tensorflow,theflofly/tensorflow,aam-at/tensorflow,arborh/tensorflow,cxxgtxy/tensorflow,cxxgtxy/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,alsrgv/tensorflow,tensorflow/tensorflow,gunan/tensorflow,petewarden/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,kevin-coder/tensorflow-fork,yongtang/tensorflow,arborh/tensorflow,DavidNorman/tensorflow,Intel-tensorflow/tensorflow,karllessard/tensorflow,jendap/tensorflow,alsrgv/tensorflow,ghchinoy/tensorflow,gautam1858/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,annarev/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,jendap/tensorflow,gunan/tensorflow,gunan/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,Intel-tensorflow/tensorflow,sarvex/tensorflow,kevin-coder/tensorflow-fork,ghchinoy/tensorflow,petewarden/tensorflow,theflofly/tensorflow,chemelnucfin/tensorflow,gunan/tensorflow,gunan/tensorflow,chemelnucfin/tensorflow,xzturn/tensorflow,frreiss/tensorflow-fred,ppwwyyxx/tensorflow,ageron/tensorflow,sarvex/tensorflow,DavidNorman/tensorflow,xzturn/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,adit-chandra/tensorflow,frreiss/tensorflow-fred,theflofly/tensorflow,paolodedios/tensorflow,gunan/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_saved_model,xzturn/tensorflow,jbedorf/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_saved_model,alsrgv/tensorflow,annarev/tensorflow,alsrgv/tensorflow,theflofly/tensorflow,jendap/tensorflow,ageron/tensorflow,DavidNorman/tensorflow,aldian/tensorflow,sarvex/tensorflow,alsrgv/tensorflow,petewarden/tensorflow,aldian/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,aam-at/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,kevin-coder/tensorflow-fork,DavidNorman/tensorflow,arborh/tensorflow,ageron/tensorflow,annarev/tensorflow,theflofly/tensorflow,davidzchen/tensorflow,arborh/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow,karllessard/tensorflow,jhseu/tensorflow,tensorflow/tensorflow-pywrap_saved_model,annarev/tensorflow,renyi533/tensorflow,xzturn/tensorflow,sarvex/tensorflow,jendap/tensorflow,jbedorf/tensorflow,ppwwyyxx/tensorflow,Intel-Corporation/tensorflow,DavidNorman/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,renyi533/tensorflow,davidzchen/tensorflow,xzturn/tensorflow,Intel-tensorflow/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,ghchinoy/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,paolodedios/tensorflow,kevin-coder/tensorflow-fork,jendap/tensorflow,aam-at/tensorflow,theflofly/tensorflow,chemelnucfin/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,chemelnucfin/tensorflow,kevin-coder/tensorflow-fork,jhseu/tensorflow,gunan/tensorflow,DavidNorman/tensorflow,adit-chandra/tensorflow,xzturn/tensorflow,jhseu/tensorflow,karllessard/tensorflow,kevin-coder/tensorflow-fork,ghchinoy/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,xzturn/tensorflow,DavidNorman/tensorflow,Intel-Corporation/tensorflow,renyi533/tensorflow,freedomtan/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,arborh/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,cxxgtxy/tensorflow,ageron/tensorflow,ageron/tensorflow,aam-at/tensorflow,paolodedios/tensorflow,jbedorf/tensorflow,annarev/tensorflow,gautam1858/tensorflow,renyi533/tensorflow,Intel-tensorflow/tensorflow,aldian/tensorflow,alsrgv/tensorflow,davidzchen/tensorflow,ageron/tensorflow,ghchinoy/tensorflow,frreiss/tensorflow-fred,gautam1858/tensorflow,gunan/tensorflow,jhseu/tensorflow,renyi533/tensorflow,chemelnucfin/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,aam-at/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,paolodedios/tensorflow,karllessard/tensorflow,alsrgv/tensorflow,ghchinoy/tensorflow,jbedorf/tensorflow,jendap/tensorflow,petewarden/tensorflow,gunan/tensorflow,ghchinoy/tensorflow,sarvex/tensorflow,kevin-coder/tensorflow-fork,Intel-Corporation/tensorflow,DavidNorman/tensorflow,renyi533/tensorflow,theflofly/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,theflofly/tensorflow,yongtang/tensorflow,aldian/tensorflow,adit-chandra/tensorflow,theflofly/tensorflow,aam-at/tensorflow,chemelnucfin/tensorflow,aam-at/tensorflow,theflofly/tensorflow,tensorflow/tensorflow,chemelnucfin/tensorflow,sarvex/tensorflow,sarvex/tensorflow