[llvm-dev] Re-numbering address space with a pass

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Mon Nov 2 08:07:14 PST 2015


> On Nov 2, 2015, at 5:50 AM, Erdem Derebaşoğlu via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> My goal is to place thread-private variables in a different address space than shared variables in an OpenMP program. I found out that lifetime.start instrinsic starts the lifetime of shared objects before entering a parallel region (in IR). So I am thinking about changing the address space of all variables excluding those.
> 
> If I do it with a codegen pass, how can I look for lifetime_start/end operands (since they are defined in IR level)? And when I do an addrspacecast, how do I preserve the type?
> 
> Erdem.

This sounds like a frontend problem to me. These should be emitted in the correct address space to begin with when the IR is originally produced. What address spaces are you trying to use for these? Right now there is an unfortunate constraint on alloca that it only produces addrspace(0) pointers. I thought the lifetime intrinsics were only for allocas, so I’m not sure why you would be seeing them on some kind of shared global variable.

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151102/493e35ad/attachment.html>


More information about the llvm-dev mailing list