[LLVMdev] phi instuction example

lionheart8470 at gmail.com lionheart8470 at gmail.com
Fri Apr 18 10:09:41 PDT 2014


Hello. I'm a newbie for LLVM.

What I'm trying to do is to write the simplest program containing phi IR.
However, even though I wrote and if statements, what I get is LLVM IR not containing phi node. I tried the examples shown in LLVM documentation but it didn't work.

At first, I thought it is because of the optimization level but without optimization, it doesn't produce phi, and when using optimization level higher and equal to O1, the meaningless while loops are just removed, so I have a problem.

I think it is easy problem but, for some reasons that I don't know, I failed making one.

Can any give me simplest program producing phi?

Thanks.



More information about the llvm-dev mailing list