[LLVMdev] Regions according to LLVM

Félix Cloutier felixcca at yahoo.ca
Thu Jul 16 11:01:07 PDT 2015


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 %end
> 
> loop:
>  br i1 false, label %loop, label %end
> 
> end:
>  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: region-foo.dot
Type: application/msword
Size: 1132 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150716/29da6eba/attachment.dot>


More information about the llvm-dev mailing list