Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend alloca: Specify address space for allocation #78

Open
swaroop-sridhar opened this issue Aug 27, 2015 · 2 comments
Open

Extend alloca: Specify address space for allocation #78

swaroop-sridhar opened this issue Aug 27, 2015 · 2 comments
Assignees

Comments

@swaroop-sridhar
Copy link
Contributor

Currently the alloca instruction always allocates in the generic address space (0).
This proposal is to extend the semantics of alloca instruction to allow allocation in any specified address space.

Proposed Syntax

<result> = alloca [inalloca] <type> [, <ty> <NumElements>] [, align <alignment>] [, addrspace <num>] ; yields type addrspace(num)*:result

Motivation

Managed language clients typically use address space 1 to represent GC-pointers. Some managed clients (CLR, in particular) allow construction of GC pointers to stack locations. For example, MSIL instruction ldloca (ECMA 335, p 370) creates a GC pointer to a stack local.

Creating an addrespace(1)* pointer to a stack location currently involves two steps: the alloca, and an addrespacecast. Managed code transformations (ex: RewriteStatepointsForGC) do not handle arbitrary address space casting. So, it is desirable to obtain the addrespace(1)* pointer by construction.

Thanks,
Swaroop.

@swaroop-sridhar swaroop-sridhar self-assigned this Aug 27, 2015
@swaroop-sridhar
Copy link
Contributor Author

@swaroop-sridhar
Copy link
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant