<div dir="ltr">Hello Chen,<div><br><div>Here's some context. kernel-params-only-some-arrays.ll is a file used to test Polly's GPU codegeneration feature. I had made changes to Polly to rename the PTX functions it would produce, So these changes had to reflect in this test case as well. Here's the entire diff,</div></div><div><br></div><div></div><div dir="ltr"><div><div><font face="monospace">--- a/test/GPGPU/kernel-params-only-some-arrays.ll</font></div><div><font face="monospace">+++ b/test/GPGPU/kernel-params-only-some-arrays.ll</font></div><div><font face="monospace">@@ -16,12 +16,12 @@</font></div><div><font face="monospace"> ;        B[i] += 42;</font></div><div><font face="monospace"> ;    }</font></div><div><font face="monospace"> </font></div><div><font face="monospace">-; KERNEL: ; ModuleID = 'kernel_0'</font></div><div><font face="monospace">-; KERNEL-NEXT: source_filename = "kernel_0"</font></div></div></div><div dir="ltr"><div><div><font face="monospace">+; KERNEL: ; ModuleID = 'kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_0'</font></div><div><font face="monospace">+; KERNEL-NEXT: source_filename = "kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_0"</font></div><div><font face="monospace"> ; KERNEL-NEXT: target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"</font></div><div><font face="monospace"> ; KERNEL-NEXT: target triple = "nvptx64-nvidia-cuda"</font></div><div><font face="monospace"> </font></div><div><font face="monospace">-; KERNEL: define ptx_kernel void @kernel_0(i8 addrspace(1)* %MemRef_A)</font></div><div><font face="monospace">+; KERNEL: define ptx_kernel void @kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_0(i8 addrspace(1)* %MemRef_A)</font></div><div><font face="monospace"> ; KERNEL-NEXT:   entry:</font></div><div><font face="monospace"> ; KERNEL-NEXT:     %0 = call i32 @llvm.nvvm.read.ptx.sreg.ctaid.x()</font></div><div><font face="monospace"> ; KERNEL-NEXT:     %b0 = zext i32 %0 to i64</font></div><div><font face="monospace">@@ -31,12 +31,12 @@</font></div><div><font face="monospace"> ; KERNEL:     ret void</font></div><div><font face="monospace"> ; KERNEL-NEXT: }</font></div><div><font face="monospace"> </font></div><div><font face="monospace">-; KERNEL: ; ModuleID = 'kernel_1'</font></div><div><font face="monospace">-; KERNEL-NEXT: source_filename = "kernel_1"</font></div><div><font face="monospace">+; KERNEL: ; ModuleID = 'kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_1'</font></div><div><font face="monospace">+; KERNEL-NEXT: source_filename = "kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_1"</font></div><div><font face="monospace"> ; KERNEL-NEXT: target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v32:32:32-v64:64:64-v128:128:128-n16:32:64"</font></div><div><font face="monospace"> ; KERNEL-NEXT: target triple = "nvptx64-nvidia-cuda"</font></div><div><font face="monospace"> </font></div><div><font face="monospace">-; KERNEL: define ptx_kernel void @kernel_1(i8 addrspace(1)* %MemRef_B)</font></div><div><font face="monospace">+; KERNEL: define ptx_kernel void @kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_1(i8 addrspace(1)* %MemRef_B)</font></div><div><font face="monospace"> ; KERNEL-NEXT:   entry:</font></div><div><font face="monospace"> ; KERNEL-NEXT:     %0 = call i32 @llvm.nvvm.read.ptx.sreg.ctaid.x()</font></div><div><font face="monospace"> ; KERNEL-NEXT:     %b0 = zext i32 %0 to i64</font></div></div><div><br></div><div>I couldn't understand how "%" was actually a part of the name of a function. The module was also passed to verifyModule <a href="https://github.com/llvm-mirror/polly/blob/6b8cb877c2fa3ee0e626cac5811115a9c5c71b5b/lib/CodeGen/PPCGCodeGeneration.cpp#L1813">here</a>, which puzzles me even more.</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jun 22, 2017 at 8:07 PM 陳韋任 <<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw" target="_blank">chenwj.cs97g@g2.nctu.edu.tw</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Produces the effect,<br></div><div><div><font face="monospace">--- a/<a href="https://github.com/llvm-mirror/polly/blob/6b8cb877c2fa3ee0e626cac5811115a9c5c71b5b/test/GPGPU/kernel-params-only-some-arrays.ll#L19-L20" target="_blank">test/GPGPU/kernel-params-only-some-arrays.ll</a></font></div><div><font face="monospace">+++ b/test/GPGPU/kernel-params-only-some-arrays.ll</font></div><div><font face="monospace">@@ -16,12 +16,12 @@</font></div><div><font face="monospace"> ;        B[i] += 42;</font></div><div><font face="monospace"> ;    }</font></div><div><font face="monospace"> </font></div><div><font face="monospace">-; KERNEL: ; ModuleID = 'kernel_0'</font></div><div><font face="monospace">-; KERNEL-NEXT: source_filename = "kernel_0"</font></div><div><font face="monospace">+; KERNEL: ; ModuleID = 'kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_0'</font></div><div><font face="monospace">+; KERNEL-NEXT: source_filename = "kernel_params_only_some_arrays_%or.cond---%or.end9_kernel_0"</font></div></div><div><br></div><div>I don't understand how <a href="https://github.com/llvm-mirror/polly/blob/6b8cb877c2fa3ee0e626cac5811115a9c5c71b5b/lib/CodeGen/PPCGCodeGeneration.cpp#L1813" target="_blank">Module verification</a> was fine with this name. What are your thoughts ?</div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">​I think ModuleID and source_filename are just simple string, or they are not? I don't see any function name here.</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div><br></div>-- <br><div class="m_-144728396224881951m_7649966445297520911gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div></div></blockquote></div></div>