[LLVMdev] 64-bit to 32-bit conversion of pointers

Bill Wendling isanbard at gmail.com
Thu May 15 18:06:21 PDT 2008


On Thu, May 15, 2008 at 5:45 PM, Fernando Magno Quintao Pereira
<fernando at cs.ucla.edu> wrote:
>
> Guys, I need advice in how to handle a problem.
>
> The problem:
>     In X86_64, pointers are 64-bit variables, and are stored into 64-bit
> registers. However, some pointers are small enough that they can be
> represented as 32-bit values.
>     Is there some way, in LLVM, to recognize which pointers can be stored
> into 32-bit registers, and so modify their class accordingly? Any ideas or
> hints would be appreciated.
>
I don't think so. It really depends upon where the OS loads the
program into memory, the virtual address space, etc. It's not
something that the compiler itself is aware of. The only thing I can
think of is forcing the OS to use the lower 32-bit address space for
loading the program and creating ths stacks and heap space...

-bw



More information about the llvm-dev mailing list