[LLVMdev] Phi nodes

Anton Korobeynikov asl at math.spbu.ru
Wed Mar 28 07:21:55 PDT 2007


Hello.

> Thanks for your answers so far. I am currently stumbling into new questions. 
> Naive as i am, i thought that the llvm-bytecode is allways in SSA form. But 
> this doesn't seem to be the case. At least there are no phi instructions 
> embedded if the bytecode drops out of llvm-gcc?
Yes. llvm-gcc generates just memory references. PHI nodes are
constructed later via mem2reg pass.

> Looking into the archives this has been discussed before:
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2005-August/004730.html
> So there is stated that LLVM IR is always in SSA form.
Exactly.

> I thought that the SSA form includes PHI nodes at the beginning of each block.
What for? PHI nodes are necessary to track "multi sources" variable
assignments.

> Or is this Phi node only necessary if the input for the 
> variable is multi sourced? 
Exactly.

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.





More information about the llvm-dev mailing list