[LLVMdev] Question to Chris

Wojciech Matyjewicz wmatyjewicz at fastmail.fm
Sun Feb 3 10:33:34 PST 2008


Seung,

> 3) The way you are converting out of SSA is wrong. You will suffer  
> from lost copies. You should look at using demotePHI(). see include/ 
> llvm/Transforms/Utils/Local.h

Using demotePHI() to remove PHI nodes should be the easiest way.
However, if you want to keep values in registers, you must take into
account the problem mentioned above, and also the "swap problem". You
might take a look at this article, for example:
http://www.cs.ucsb.edu/~ckrintz/papers/spe98-ssaconstruct-deconstruct.pdf.gz
to see when these problems appear and how to deal with them. If you
address these issues, I think, your algorithm to remove PHI nodes should
be okay.

-Wojtek




More information about the llvm-dev mailing list