tensorflow/compiler/mlir/xla/transforms/legalize_tf_communication.cc
// Finds communication ops in a function. `control_flow_ops` and
// `control_flow_blocks` will be populated with control flow op ancestors for
// every communication op.
Finds communication ops in a function. `control_flow_ops` and
`control_flow_blocks` will be populated with control flow op ancestors for
every communication op.
Finds communication ops in a function . ` control_flow_ops ` and ` control_flow_blocks ` will be populated with control flow op ancestors for every communication op .
LogicalResult FindCommunicationOps(
    FuncOp func, llvm::SmallPtrSetImpl<Operation*>& control_flow_ops,
    llvm::SmallPtrSetImpl<Block*>& control_flow_blocks,
    bool& has_communication_ops) {
  auto result = func.walk([&](Operation* op) {
    if (!IsCommunicationOp(op)) return WalkResult::advance();
    has_communication_ops = true;
    if (failed(
            GetControlFlowAncestors(op, control_flow_ops, control_flow_blocks)))
      return WalkResult::interrupt();
    return WalkResult::advance();
  });
  return failure(result.wasInterrupted());
}
LogicalResult FindCommunicationOps ( FuncOp func , llvm :: SmallPtrSetImpl < Operation * > & control_flow_ops , llvm :: SmallPtrSetImpl < Block * > & control_flow_blocks , bool & has_communication_ops ) { auto result = func . walk ( [ & ] ( Operation * op ) { if ( ! IsCommunicationOp ( op ) ) return WalkResult :: advance ( ) ; has_communication_ops = true ; if ( failed ( GetControlFlowAncestors ( op , control_flow_ops , control_flow_blocks ) ) ) return WalkResult :: interrupt ( ) ; return WalkResult :: advance ( ) ; } ) ; return failure ( result . wasInterrupted ( ) ) ; }
Finds communication ops in a function.
Finds communication ops in a function .