[LLVMdev] unwinds to in the CFG

Gordon Henriksen gordonhenriksen at mac.com
Fri Mar 28 09:26:16 PDT 2008


Hi Nick,

On Mar 28, 2008, at 02:15, Nick Lewycky wrote:

> Before I start investing time implementing these changes, does  
> anyone foresee any problems that I missed?

Stepping back from the nuts and bolts for a moment, could you  
precisely define what constitutes a predecessor in this model?

What blocks would a phi node in %catch require for a case like this?

define i8 @f(i1 %b) {
entry:
   b label %try
try: unwinds to %catch
   b i1 %b, label %then, label %else
then: unwinds to %catch
   ret void
else: unwinds to %catch
   ret void
catch:  ; What are my predecessors?
   ret void
}

> B. redefine the dominator tree by modifying the GraphTraits
>  i.  A dom B means that all instructions in A are guaranteed to  
> execute before any instructions in B.
>  ii. the domtree may have multiple roots.
>
> Multiple roots occurs when the entry block 'unwinds to' another block.

It seems highly problematical that static allocas might not dominate  
their uses. The entry block is already special in that it cannot be  
used as a branch target. Why not also forbid 'unwinds to' on the entry  
block?

— Gordon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080328/d701b75a/attachment.html>


More information about the llvm-dev mailing list