[LLVMdev] PHI instruction -- How to avoid and how to remove?

Török Edwin edwintorok at gmail.com
Fri Jun 4 03:22:59 PDT 2010


On 06/04/2010 01:18 PM, SHEN Hao wrote:
> Dear all,
> 
> Is there anyone knows how to configure the llvm-gcc to avoid generate
> the PHI instruction in the bytecode?

Use opt -reg2mem (however it'll also replace all virtual registers).

> If not possible, can you explain me what's the real idea of the PHI
> instruction and how to replace this instruction with a group of other
> instructions?

It is essential to the SSA representation that LLVM uses for its
analysis and transforms.

Why do you want the PHI instructions removed though?
They don't slow down your code when compiling to native instructions.

Best regards,
--Edwin



More information about the llvm-dev mailing list