[LLVMdev] where are my phi-nodes?

Duncan Sands
Mon, 13 Sep 2010 08:15:31 -0000

Hi Maarten,

> I compiled with "llvm-gcc -emit-llvm test.c -S -o test.ll".
Attached to this
> message are the source and the resulting ll output.

compile with optimization.  The llvm-gcc front-end "cheats" and
stores/loads all
values to/from memory, avoiding the need to construct phi nodes; instead it lets
the optimizers do that.  For what it's worth the dragonegg plugin produces
phi
nodes directly, even at -O0.  I don't know what clang does.

Ciao,

Duncan.