[LLVMdev] Mandatory duplicated incoming nodes on phis

Gary Benson gbenson at redhat.com
Thu Aug 28 00:37:54 PDT 2008


Chris Lattner wrote:
> On Aug 27, 2008, at 3:37 AM, Gary Benson wrote:
> > I noticed that if you create a switch with multiple cases going to
> > the same destination, then if that destination contains phis you
> > need to add the incoming value an equivalent number of times.
> > The attached code seems wrong, but it compiles as correct, and
> > removing the duplicated incoming node causes an error.  Is this
> > expected?
> 
> I agree that this is somewhat annoying, but it is required to
> maintain the invariant that a phi node in a block has the same
> number of entries as the block has predecessors.

That's cool, it's not annoying, just not what I expected :)

Cheers,
Gary

-- 
http://gbenson.net/



More information about the llvm-dev mailing list