lib/Hask/WorkerWrapperPass.cpp
// find the single case op of v that is at the same level as of v.
// We can have other uses of v nested inside the case op that is found.
// If there are multiple uses, then give up.
find the single case op of v that is at the same level as of v.
We can have other uses of v nested inside the case op that is found.
If there are multiple uses, then give up.
find the single case op of v that is at the same level as of v . We can have other uses of v nested inside the case op that is found . If there are multiple uses then give up .
CaseOp findSingleCaseOpUse(BlockArgument v, Region *r) {
  CaseOp c;
  for (auto it : v.getUsers()) {
    if (!c) {
      if (it->getParentRegion() != r) {
        continue;
      }
      c = mlir::dyn_cast<CaseOp>(*it);
    } else {
      if (c.getOperation()->isAncestor(it)) {
        continue;
      }
    }
  }
  return c;
}
CaseOp findSingleCaseOpUse ( BlockArgument v , Region * r ) { CaseOp c ; for ( auto it : v . getUsers ( ) ) { if ( ! c ) { if ( it -> getParentRegion ( ) != r ) { continue ; } c = mlir :: dyn_cast < CaseOp > ( * it ) ; } else { if ( c . getOperation ( ) -> isAncestor ( it ) ) { continue ; } } } return c ; }
find the single case op of v that is at the same level as of v.
We can have other uses of v nested inside the case op that is found.
find the single case op of v that is at the same level as of v . We can have other uses of v nested inside the case op that is found .
// the case is not a top-level case. ignored. // we found an operation that is *not* the ancestor of the // case of we believe is the corret one.