<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";}
span.EmailStyle17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle19
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans-serif";}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Sam,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Interesting idea, I am just concerned whether target-dependent attribute-value pairs are really correct for this use case. Because kernel attributes aren’t really target dependent.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">However, I agree that current approach is painful enough. Do you think switching to function metadata (see llvm@r235783) would help instead? This way we will also have the kernel attributes directly accessible
from the function, simplifying querying them (as compared to what we have at the moment).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Anastasia<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Mekhanoshin, Stanislav [mailto:Stanislav.Mekhanoshin@amd.com]
<br>
<b>Sent:</b> 09 May 2016 21:14<br>
<b>To:</b> Liu, Yaxun (Sam); cfe-dev (cfe-dev@lists.llvm.org); Anastasia Stulova; Pan, Xiuli; Bader, Alexey (alexey.bader@intel.com)<br>
<b>Cc:</b> Stellard, Thomas; Sumner, Brian<br>
<b>Subject:</b> RE: [OpenCL] Representing kernel attributes by LLVM target-dependent attribute-value pairs instead of metadata<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US">It will make our life much easier I would say.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-US" style="color:#1F497D">Stas<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="RU" style="color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Liu, Yaxun (Sam)
<br>
<b>Sent:</b> Monday, May 09, 2016 1:05 PM<br>
<b>To:</b> cfe-dev (<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>) <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>>; 'anastasia.stulova@arm.com' <<a href="mailto:anastasia.stulova@arm.com">anastasia.stulova@arm.com</a>>;
Pan, Xiuli <<a href="mailto:xiuli.pan@intel.com">xiuli.pan@intel.com</a>>; Bader, Alexey (<a href="mailto:alexey.bader@intel.com">alexey.bader@intel.com</a>) <<a href="mailto:alexey.bader@intel.com">alexey.bader@intel.com</a>><br>
<b>Cc:</b> Stellard, Thomas <<a href="mailto:Tom.Stellard@amd.com">Tom.Stellard@amd.com</a>>; Sumner, Brian <<a href="mailto:Brian.Sumner@amd.com">Brian.Sumner@amd.com</a>>; Mekhanoshin, Stanislav <<a href="mailto:Stanislav.Mekhanoshin@amd.com">Stanislav.Mekhanoshin@amd.com</a>><br>
<b>Subject:</b> [OpenCL] Representing kernel attributes by LLVM target-dependent attribute-value pairs instead of metadata<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><span lang="RU"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">When SPIR 1.2/2.0 spec was developed, there was no target-dependent attribute-value pair in LLVM. As such, kernel attributes were represented as metadata.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">This caused lots of inconvenience since these metadata are difficult to manipulate/change when kernel functions went through transformations in backends.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Now LLVM supports target-dependent attribute-value pair, I am wondering whether it is time to use that to represent kernel attributes.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">e.g. something like (just to give an idea, not exact llvm IR)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">kernel void foo(global int*a, sampler_t s); #1<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">#1 = {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">reqd_work_group_size=”1 1 1”,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">kernel_arg_type=”int *, sampler_t”,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">basically we keep the info conveyed by the original metadata but attach them to the kernel function as attribute/value pair. This will make these attributes much easier to manipulate/change.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Any feedbacks? Thanks.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US">Sam<o:p></o:p></span></p>
</div>
</body>
</html>