[LLVMdev] PHIs with Same Basic Block Listed Twice

Dale Johannesen dalej at apple.com
Tue Mar 17 11:56:21 PDT 2009


On Mar 17, 2009, at 11:37 AMPDT, John Criswell wrote:

> Dear All,
>
> I have, in an LLVM bitcode program, the following phi node:
>
> %iftmp.225.0 = phi i8* [ getelementptr ([10 x i8]* @.str12597431,  
> i32 0,
> i32 0), %bb114 ], [ getelementptr ([10 x i8]* @.str1258, i32 0, i32  
> 0),
> %bb111 ], [ getelementptr ([10 x i8]* @.str1258, i32 0, i32 0),  
> %bb111 ]
>
> This phi instruction has two arguments for the same incoming basic
> block.  The only reason why it passes verification right now is  
> because
> the same constant expression is used for the same basic block.
>
> Does anyone know what might be causing this phi to have the same
> incoming block listed multiple times?  Should LLVM consider such a phi
> valid?

I'm pretty sure I've seen this where %bb111 ends in a switch that has  
two cases that both lead to this phi.




More information about the llvm-dev mailing list