Hi,<br><br>How does the requirement that phi instructions have one value per predecessor basic block interact with indirectbr instructions?  For instance, take the following code:<br><br>L1:<br>   br i1 %somevalue, label %L2, label %L3<br>
L2:<br>   %ret1 = i8* blockaddress(@myfunction, %L5)<br>   br label %L4<br>L3:<br>   %ret2 = i8* blockaddress(@myfunction, %L6)<br>   br label %L4<br>L4:<br>   %ret = phi i8* [%ret1, L2], [%ret2, L3]<br>   indirectbr i8* %ret, [label %L5, label %L6]<br>
L5:<br>   %myval = phi i32 [0, %L2], [1, %L3] ; are both of these values required, even though the only *real* possible predecessor block is L2?<br>   ret i32 %myval<br>L6:<br>   %myval = phi i32 [0, %L2], [1, %L3] ; likewise<br>
   ret i32 %myval<br><br>Boiled down, I think my question is, "how strict is the 'one value per predecessor block'  rule on a phi instruction?"<br><br>FYI, I am planning on using indirectbr to implement jsr and ret instructions in Java.  I fully expect that there are syntax errors in the above code - but I hope you get the idea.<br>
<br>Thanks,<br><br>Joshua<br>