<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 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@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:0in;
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:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma",sans-serif;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle22
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle23
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#1F497D">Hi Anastasia,<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">Target-dependent attribute-value pair is not limited to one target. It is just a pair of strings attached to a function. It can be used by different targets as far as they accept a commonly agreed attribute name.<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">The function metadata also requires a commonly agreed attribute name. In this aspect it is similar to target-dependent attribute-value pair. However it may be more difficult to manipulate.<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">Stas, any comments on this?<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"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">Sam<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 #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Anastasia Stulova [mailto:Anastasia.Stulova@arm.com]
<br>
<b>Sent:</b> Wednesday, May 11, 2016 12:32 PM<br>
<b>To:</b> Mekhanoshin, Stanislav <Stanislav.Mekhanoshin@amd.com>; Liu, Yaxun (Sam) <Yaxun.Liu@amd.com>; cfe-dev (cfe-dev@lists.llvm.org) <cfe-dev@lists.llvm.org>; Pan, Xiuli <xiuli.pan@intel.com>; Bader, Alexey (alexey.bader@intel.com) <alexey.bader@intel.com><br>
<b>Cc:</b> Stellard, Thomas <Tom.Stellard@amd.com>; Sumner, Brian <Brian.Sumner@amd.com>; nd <nd@arm.com><br>
<b>Subject:</b> RE: [OpenCL] Representing kernel attributes by LLVM target-dependent attribute-value pairs instead of metadata<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F497D">Hi Sam,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" 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 lang="EN-GB" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" 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 lang="EN-GB" style="color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F497D">Anastasia<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma",sans-serif"> Mekhanoshin, Stanislav [<a href="mailto:Stanislav.Mekhanoshin@amd.com">mailto:Stanislav.Mekhanoshin@amd.com</a>]
<br>
<b>Sent:</b> 09 May 2016 21:14<br>
<b>To:</b> Liu, Yaxun (Sam); cfe-dev (<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>); Anastasia Stulova; Pan, Xiuli; Bader, Alexey (<a href="mailto:alexey.bader@intel.com">alexey.bader@intel.com</a>)<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"><span lang="EN-GB"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D">It will make our life much easier I would say.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span style="color:#1F497D">Stas<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><span lang="RU" style="color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> 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></p>
</div>
</div>
<p class="MsoNormal"><span lang="RU"><o:p> </o:p></span></p>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">e.g. something like (just to give an idea, not exact llvm IR)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">kernel void foo(global int*a, sampler_t s); #1<o:p></o:p></p>
<p class="MsoNormal">#1 = {<o:p></o:p></p>
<p class="MsoNormal">reqd_work_group_size=”1 1 1”,<o:p></o:p></p>
<p class="MsoNormal">kernel_arg_type=”int *, sampler_t”,<o:p></o:p></p>
<p class="MsoNormal">…<o:p></o:p></p>
<p class="MsoNormal">}<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">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></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any feedbacks? Thanks.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Sam<o:p></o:p></p>
</div>
</body>
</html>