<div dir="ltr">Address space 4 globals should be going into .const.  Please open a bug report and provide a repro .ll file.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 7, 2013 at 11:37 AM, Antony Yu <span dir="ltr"><<a href="mailto:swpenim@gmail.com" target="_blank">swpenim@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I work on compiling OpenCL kernel to PTX code by clang and NVPTX with<br>
libclc.<br>
I have a kernel that contains constant variable declared in file scope like<br>
this:<br>
<br>
   constant one_f = 1.0f;<br>
__kernel void test( ...){    ...  }<br>
<br>
Then it is compiled to llvm-ir:<br>
<br>
@one_f = addrspace(4) const float 1.000000e+00, align 4<br>
define void test(...){   ...   }<br>
<br>
Finally ptx:<br>
<br>
.visible .global .align 4 .f32 one_f = 0f3F800000;<br>
.entry test( ...) { ... }<br>
<br>
one_f is placed in global memory and load it by ld.global.f32<br>
But I want one_f to be placed in constant memory and load it by<br>
ld.const.f32. Is it any way to achieve this ??<br>
<br>
Thanks in advance.<br>
Antony Yu<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://llvm.1065342.n5.nabble.com/How-to-generate-constant-memory-for-ptx-code-by-NVPTX-tp58384.html" target="_blank">http://llvm.1065342.n5.nabble.com/How-to-generate-constant-memory-for-ptx-code-by-NVPTX-tp58384.html</a><br>

Sent from the LLVM - Dev mailing list archive at Nabble.com.<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div>
</div>