[LLVMdev] converting x86 instructions to LLVM instructions

Tilmann Scheller tilmann.scheller at googlemail.com
Tue Sep 29 06:48:53 PDT 2009

Hi Alexandre,

On Tue, Sep 29, 2009 at 12:14 PM, Alexandre Gouraud
<alexandre.gouraud at enst-bretagne.fr> wrote:
> I am studying a paper (cf below) that says they have written a piece of code
> to translate x86 instructions to LLVM. I am interested in this, and would
> like to write the same kind of thing, but not using QEMU as they claim in
> the paper, but rather with my own pin tool.
> From what I have red until now on LLVM, and my relative poor knowledge of
> assembly, I have the feeling that this is a huge task (many months of work).
> This holds me back to dig into it and I would well be encouraged if I knew
> that this is an easy thing for some of you, experts. If there was a public
> piece of code that does it already would be awesome of course. The paper is
> mentioning this (http://code.google.com/p/llvm-qemu/) but I am not sure it
> would lead me where I want.
Changing llvm-qemu to use x86 is a matter of a few hours (only trivial
changes to the source code are required). Nevertheless, I believe
valgrind is a better choice for you if your goal is dynamic binary
instrumentation (simply because it was designed for this purpose).
However, it also depends on whether you want to generate LLVM IR or
not. If you do, llvm-qemu might be the better choice.

Are there particular reasons why you want to translate to LLVM IR?
(E.g. the authors of the paper wanted to be able to use KLEE with
machine code)



More information about the llvm-dev mailing list