PHIs with Same Basic Block Listed Twice

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?

-- John T.

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

Does such a block have two outgoing edges?
IE if i walk the predecessors of the successor, do i hit the same block twice?
If so, then PHI's with two arguments from the same block would be legal.

--Dan