<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Nov 2, 2015, at 5:50 AM, Erdem Derebaşoğlu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Calibri; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">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.<div class=""><br class=""></div><div class="">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?</div><div class=""><br class=""></div><div class="">Erdem.<br class=""></div></div></div></blockquote><div><br class=""></div><div>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.</div><div><br class=""></div><div>-Matt</div></div></body></html>