Hi all,
I'm working with regions, and I was surprised by the region set of this function:
define void @foo() {
br i1 false, label %loop, label %endloop:
br i1 false, label %loop, label %endend:
ret void
}
.dot file as generated by opt —view-regions attached. Essentially, there are 3 regions: one that has the whole function, one that has the entry block and the loop, and one that has the loop only.
The second one puzzles me. The definition of single-entry single-exit region that I know of uses edges instead of blocks but can rather easily be extended to blocks: edge A dominates edge B, edge B postdominates edge A, and any cycle containing edge A also contains edge B.
I'm confused because in the case of the second region, the loop block does not postdominate the entry, and I can't think of a pair of edges around these that work without being equivalent to the last region.
Am I missing something?
Félix
region-foo.dot (1.11 KB)