Hi,<div><br></div><div>I'd like to see how clang handles local memory in OpenCL. So I compiled the following code with "clang -S -emit-llvm -o test.ll -x cl <a href="http://test.cl">test.cl</a>".</div><div><br>
</div><div><div>int get_global_id(int index);                                                                                                                         </div><div>                                                                                                                                                      </div>
<div>/* Test kernel */                                                                                                                                     </div><div>__kernel void test(__global float *in, __global float *out) {                                                                                         </div>
<div>        int index = get_global_id(0);                                                                                                                 </div><div>        out[index] = 3.14159f * in[index] + in[index];                                                                                                </div>
<div>}        </div><div><br></div><div>Then I changed "__global" to "__local" and generate the IR again, but the generated IR is the same as the first one.</div><div><br></div><div>I am confused because if the "__local" information is lost when generating LLVM IR, how can local memory be used anyway?</div>
<div><br></div><div>Thanks,</div><div>Bo</div><div><br></div><br><br>
</div>