Lines Matching full:region

91   if (Region *region = sourceNo.getRegionOrNull())  in printRegionEdgeName()  local
92 diag << "Region #" << region->getRegionNumber(); in printRegionEdgeName()
97 if (Region *region = succRegionNo.getRegionOrNull()) in printRegionEdgeName() local
98 diag << "Region #" << region->getRegionNumber(); in printRegionEdgeName()
104 /// Verify that types match along all region control flow edges originating from
106 /// types of the inputs that flow to a successor region.
123 InFlightDiagnostic diag = op->emitOpError(" region control flow edge "); in verifyTypesAlongAllEdges()
171 // Verify types along control flow edges originating from each region. in verifyTypesAlongControlFlowEdges()
172 for (Region &region : op->getRegions()) { in verifyTypesAlongControlFlowEdges()
176 // types when passing them to the same region. in verifyTypesAlongControlFlowEdges()
179 for (Block &block : region) in verifyTypesAlongControlFlowEdges()
206 return printRegionEdgeName(diag, region, point) in verifyTypesAlongControlFlowEdges()
215 if (failed(verifyTypesAlongAllEdges(op, region, inputTypesForRegion))) in verifyTypesAlongControlFlowEdges()
223 /// this function returns "true" for a successor region. The first parameter is
224 /// the successor region. The second parameter indicates all already visited
226 using StopConditionFn = function_ref<bool(Region *, ArrayRef<bool> visited)>;
228 /// Traverse the region graph starting at `begin`. The traversal is interrupted
229 /// if `stopCondition` evaluates to "true" for a successor region. In that case,
232 static bool traverseRegionGraph(Region *begin, in traverseRegionGraph()
238 // Retrieve all successors of the region and enqueue them in the worklist. in traverseRegionGraph()
239 SmallVector<Region *> worklist; in traverseRegionGraph()
240 auto enqueueAllSuccessors = [&](Region *region) { in traverseRegionGraph() argument
242 op.getSuccessorRegions(region, successors); in traverseRegionGraph()
251 Region *nextRegion = worklist.pop_back_val(); in traverseRegionGraph()
263 /// Return `true` if region `r` is reachable from region `begin` according to
265 static bool isRegionReachable(Region *begin, Region *r) { in isRegionReachable()
269 [&](Region *nextRegion, ArrayRef<bool> visited) { in isRegionReachable()
299 Region *regionA = nullptr, *regionB = nullptr; in insideMutuallyExclusiveRegions()
300 for (Region &r : branchOp->getRegions()) { in insideMutuallyExclusiveRegions()
302 assert(!regionA && "already found a region for a"); in insideMutuallyExclusiveRegions()
306 assert(!regionB && "already found a region for b"); in insideMutuallyExclusiveRegions()
310 assert(regionA && regionB && "could not find region of op"); in insideMutuallyExclusiveRegions()
313 // distinct and neither region is reachable from the other region. in insideMutuallyExclusiveRegions()
324 Region *region = &getOperation()->getRegion(index); in isRepetitiveRegion() local
325 return isRegionReachable(region, region); in isRepetitiveRegion()
334 [](Region *nextRegion, ArrayRef<bool> visited) { in hasLoop()
335 // Interrupt traversal if the region was already in hasLoop()
343 Region *mlir::getEnclosingRepetitiveRegion(Operation *op) { in getEnclosingRepetitiveRegion()
344 while (Region *region = op->getParentRegion()) { in getEnclosingRepetitiveRegion() local
345 op = region->getParentOp(); in getEnclosingRepetitiveRegion()
347 if (branchOp.isRepetitiveRegion(region->getRegionNumber())) in getEnclosingRepetitiveRegion()
348 return region; in getEnclosingRepetitiveRegion()
353 Region *mlir::getEnclosingRepetitiveRegion(Value value) { in getEnclosingRepetitiveRegion()
354 Region *region = value.getParentRegion(); in getEnclosingRepetitiveRegion() local
355 while (region) { in getEnclosingRepetitiveRegion()
356 Operation *op = region->getParentOp(); in getEnclosingRepetitiveRegion()
358 if (branchOp.isRepetitiveRegion(region->getRegionNumber())) in getEnclosingRepetitiveRegion()
359 return region; in getEnclosingRepetitiveRegion()
360 region = op->getParentRegion(); in getEnclosingRepetitiveRegion()