LLVM has phi instruction with quite weird explanation:
The \'phi\' instruction is used to implement the φ node in the SSA graph representing the function
You don't need to use phi at all. Just create bunch of temporary variables. LLVM optimization passes will take care of optimizing temporary variables away and will use phi node for that automatically.
For example, if you want to do this:
x = 4;
if (something) x = x + 2;
print(x);
You can use phi node for that (in pseudocode):
But you can do without phi node (in pseudocode):
By running optimization passes with llvm this second code will get optimized to first code.