[LLVMdev] Marking *some* pointers for gc
Ramkumar Ramachandra
artagnon at gmail.com
Sun Jan 18 10:40:00 PST 2015
Sanjoy Das wrote:
> In your
> example, foo will have to treat its argument differently depending on
> whether it is a GC pointer or not.
In practice, this is not true of many functions that don't call other
functions. Take the example of a simple "print" function that takes a
void * to cast and print, type_int to determine what to cast to: why
should it care about whether the pointer is GC'able or not? In the
callsite, I have this information, and I accordingly emit
statepoint/relocate information. But "print" doesn't call other
functions, and doesn't need to emit statepoint/relocate.
Let's say I made the void * argument addrspace(0). Then, in callsites
where I have an addrspace(1) to pass, I have to emit:
addrspacecast 1 -> 0
call print
addrspacecast 0 -> 1
Is the ideal workflow, or should we have some sort of addrspaceany?
More information about the llvm-dev
mailing list