I'am now considering converting x86 machine assembly into LLVM IR, does anyone know about any existing project or resource related to this area? Any difficulities or any ideas on this? thanks for your replies in advance. cradnil 2008-03-04 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080304/bf8bda46/attachment.html>
Holger Schurig
2008-Mar-04 06:44 UTC
[LLVMdev] Any idea on translate x86 assembly to LLVM IR?
> I'am now considering converting x86 machine assembly into LLVM > IR, does anyone know about any existing project or resource > related to this area? Any difficulities or any ideas on this?There is a idea floating around that LLVM and QEMU could be married. QEMU has sort-of-a-disassembler, where they generate little pieces of code and later let that code execute (it's actually a bit different, but hey, use the source). The idea was to replace that part with an LLVM IR generation. Then you can use standard LLVM optimization passes on this and/or run this code via JIT. Anyway, the disassembler-part of QEMU is easy to rip out, for me it was easier than, say, the libbfd based disassemblers, which are highly optimized to produce human readable strings.
This is a hard problem. Machine assembly is (mostly) untyped. You also have to reconstruct CFG, translate it back to SSA form. Not to mention how do you translate instructions where there is no equivalent llvm instruction. Evan On Mar 3, 2008, at 9:48 PM, cradnil wrote:> I'am now considering converting x86 machine assembly into LLVM IR, > does anyone know about any existing project or resource related to > this area? > Any difficulities or any ideas on this? > > thanks for your replies in advance. > > cradnil > 2008-03-04 > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080303/b0dd02b0/attachment.html>