Return true if `op` is the Merge for a conditional.
(op)
| 131 | |
| 132 | |
| 133 | def IsCondMerge(op): |
| 134 | """Return true if `op` is the Merge for a conditional.""" |
| 135 | if not IsMerge(op): |
| 136 | return False |
| 137 | if not op.inputs: |
| 138 | return False |
| 139 | # Merge nodes are not part of the cond control flow context that they |
| 140 | # represent, so consider the inputs to the merge of to determine if it is |
| 141 | # cond merge or not: A merge is a cond merge iff all its inputs are in |
| 142 | # cond contexts. |
| 143 | is_cond_merge = True |
| 144 | for i in op.inputs: |
| 145 | ctxt = GetOutputContext(i.op) |
| 146 | is_cond_merge = is_cond_merge and ctxt is not None and ctxt.IsCondContext() |
| 147 | return is_cond_merge |
| 148 | |
| 149 | |
| 150 | def IsLoopSwitch(op): |
no test coverage detected