[LLVMdev] Doubt on phi nodes

Duncan Sands baldrick at free.fr
Sun Jun 12 11:47:39 PDT 2011


Hi Carlo,

> I have a doubt on the usage of phi nodes in LLVM: if I define a value in a bb,
> are phi nodes needed in the blocks that are dominated by the bb where the value
> is defined?
> As an example consider the following trivial example:
> // BB0
> A = 5;
> if (condition) { // BB1
> B = 2;
> } else { // BB2
> B = 1;
> }
> // BB3
> is a phi node required for A in BB3?

no, it is not required AFAIK.

Ciao, Duncan.



More information about the llvm-dev mailing list