[LLVMdev] Global register variables/custom calling conventions

Tilmann Scheller tilmann.scheller at googlemail.com
Fri Sep 25 01:35:36 PDT 2009

Hi Andrew,

On Wed, Sep 23, 2009 at 7:26 AM, Andrew Jeffery <andrew at aj.id.au> wrote:
> TCG seperates the guest (ARM) code into blocks - my front end translates
> these to LLVM IR for LLVM to translate to x86.  The assumption is that LLVM
> will produce a better translation than TCG*. At some future point the
> TCG-generated native block is replaced by the LLVM's, and as such it needs
> to hand control back to qemu in a state that it would expect from TCG.
> Essentially the idea is to take the same input and produce the same output
> as the original TCG block, but munge things in the middle to (hopefully) be
> more efficient using LLVM's local optimisations.
I'm curious, are you translating directly from ARM to LLVM IR or from

llvm-qemu just put the pinned variables into memory (and lived with
the performance penalty), but I agree it would be much nicer to have a
custom calling convention in order to avoid this.



More information about the llvm-dev mailing list