How to deal with phi-nodes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to deal with phi-nodes

Seung Jae Lee
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
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: How to deal with phi-nodes

Fernando Magno Quintao Pereira

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
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev