[LLVMdev] x86-64 large stack offsets

David A. Greene greened at obbligato.org
Mon Sep 26 14:46:21 PDT 2011


Jakob Stoklund Olesen <stoklund at 2pi.dk> writes:


Hi Jakob,

Thanks for the responses.

> As you have noticed, the x86 backend only supports stack frames up to 2GB.

That's unfortunate.  :(

> Fixing that would require the x86 backend to use the register
> scavenger during prolog epilog insertion like the ARM backend does.

Makes sense.

> That particular code was very difficult to get right, and no one has
> thought it was worth the trouble to get it working for x86.

I wouldn't imagine so, since these kinds of large stack objects are
rather rare in the C world.  They are somewhat more common in the
Fortran world.  :)

> Your life will be a whole lot easier if you just use malloc().

Perhaps.  This is customer-written code and they will (probably) not be
willing to change it.  We could replace the allocas with malloc/free
under the hood but we haven't needed to do that on past platforms.  It's
certainly a mildly large change in our compiler in the sense of how
resources get allocated.  It is certainly doable but for various reasons
may be undesirable.

Do you have a feel for the complexity involved with the ARM code?  What
were the troublesome parts and corner cases, etc.?

                             -Dave



More information about the llvm-dev mailing list