[LLVMdev] addrspace attribute and intrisics

Gordon Henriksen gordonhenriksen at mac.com
Mon Jul 7 05:43:24 PDT 2008


On 2008-07-07, at 05:40, Benedict Gaster wrote:

>         %r1 = call i32 @llvm.atomic.load.add.p0i32( i32 addrspace(0)*
> %ptr0, i32 4)
> 	%r2 = call i32 @llvm.atomic.load.add.p11i32( i32 addrspace(11)*
> %ptr11, i32 4)
> 	call void @llvm.memory.barrier(i1 true, i1 true, i1 false, i1 false,
> i32 11, i1 false) ; force read-modify-write %ptr11 to complete
>
> A problem with this approach is that developing a new pass over the  
> IL that works with address spaces, will have to include knowledge  
> that for certain operations address space information is encoded as  
> data rather than as types and in general, it may not be able to  
> statically determine the particular address space.

It's quite possible to restrict an argument to an intrinsic to an  
immediate constant. See llvm.gcroot for an example.

— Gordon





More information about the llvm-dev mailing list