[LLVMdev] Address Space

Eli Friedman eli.friedman at gmail.com
Mon Jul 6 13:11:50 PDT 2009

On Mon, Jul 6, 2009 at 11:43 AM, Juan Carlos Martinez
Santos<juanc.martinez.santos at gmail.com> wrote:
> Looking the Language Reference, there is something called "addrspace". It
> can be used to allocate a global variable into a specific area (always that
> the target supports it). How I can modify the ARM back-end in order to
> support at least two memory sections for Global Variables in the BSS
> section. My idea is to split the uninitialized global variables in two
> sections and to aggregate them depends on the uses of each variable at
> execution time (by profiling I will know what variable will be in each
> section).

This can be done with the existing section markings for globals;
address spaces are intended for situations where the spaces actually
have distinct properties.

> In addition, can I add more address spaces for heap and stack also? For
> exampe, can I split my stack in two segments, one to hold critical info like
> return address and frame pointer, and another to hold function arguments?
> How I can do it?

You don't need address spaces for that; it's just a matter of using
different heap allocation functions and a custom calling convention.


More information about the llvm-dev mailing list