[LLVMdev] How to deal with phi-nodes

Fernando Magno Quintao Pereira fernando at CS.UCLA.EDU
Fri Jan 4 18:10:44 PST 2008


Dear Seung Jae Lee,

     I believe, and the others may correct me if I am mistaken, that LLVM 
does not keep information necessary to return to pre-SSA-form. Actually, 
some optimizations, like constant folding, end up deleting some copies, 
and the SSA-form used in LLVM may contain variables in the same 
phi-function that interfere.
      If you want to convert the program into a format in which no variable 
in the same phi-function interfere, I have a pass to do that. Once that is 
done, you can simply replace all the variables related by phi-functions 
with a single name, which, of course, could be defined many times.

best,

Fernando

> Hi, LLVMers.
>
> I am trying to restore the original HL code from LLVM IR (kinda reverse engineering).
> However, I have no good idea about how to handle PHI nodes. It is quite tricky for me to deal with the PHI nodes in LLVM IR in order to restore the original-like code. I read some reverse engineering thesis but they are a little bit old so don't handle SSA form.
>
> Could you shed some lights on me how I can give it a shot?
> It also should be greatly appreciated if you can introduce some references about that.
>
> Thanks,
> Seung
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



More information about the llvm-dev mailing list