<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=utf-8">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@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:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        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.apple-converted-space
        {mso-style-name:apple-converted-space;}
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-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:799957587;
        mso-list-type:hybrid;
        mso-list-template-ids:-1214880770 44585902 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></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="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Thank you, I’ll take it.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal" style="margin-left:36.0pt;text-indent:-18.0pt;mso-list:l0 level1 lfo1">
<![if !supportLists]><span style="font-family:"Calibri","sans-serif";color:#31849B"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span dir="LTR"></span><b><i><span style="color:#31849B"> Elena<o:p></o:p></span></i></b></p>
</div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";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 style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Pete Cooper [mailto:peter_cooper@apple.com]
<br>
<b>Sent:</b> Tuesday, October 28, 2014 19:28<br>
<b>To:</b> Demikhovsky, Elena<br>
<b>Cc:</b> Philip Reames; Hal Finkel; llvmdev@cs.uiuc.edu<br>
<b>Subject:</b> Re: [LLVMdev] Masked vector intrinsics and name mangling<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal">On Oct 27, 2014, at 2:45 AM, Demikhovsky, Elena <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>> wrote:<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
Thank you. I'll reopen the question when I will have the intrinsics completed.</span><o:p></o:p></p>
</div>
</blockquote>
<div>
<p class="MsoNormal">I think we can actually handle this with only a minor improvement to the existing intrinsic code.  For example, fabs is defined as <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">def int_fabs : Intrinsic<[llvm_anyfloat_ty], [LLVMMatchType<0>]>;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">and so you can just write one type, not two: @llvm.fabs.f64(double %Val)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Similarly, you gave this definition<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<div>
<p class="MsoNormal">def int_masked_load :<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">      Intrinsic<[llvm_anyvector_ty], [llvm_anyptr_ty, llvm_anyvector_ty, llvm_anyint_ty, llvm_anyvector_ty],<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">                [IntrReadArgMem, NoNameMangling]>; // new property<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<div>
<p class="MsoNormal">but we could add some new types (and force alignment to i32 which matches memcpy) to make it<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">def int_masked_load :<br>
      Intrinsic<[llvm_anyvector_ty], [LLVMPointerToType<0>, LLVMMatchType<0>, llvm_i32_ty, LLVMVectorWithSameWidth<0, llvm_i1_ty>],<br>
                [IntrReadArgMem]>;<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Now LLVM can infer everything from the return type and so the whole name here is<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">%res = call <16 x i32> @llvm.masked.load.v16i32(<16 x i32>* %addr, <16 x i32>%passthru, i32 4, <16 x i1> %mask)<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Note that i’ve defined 'LLVMPointerToType<0>’ here which would make the first argument a vector pointer.  If you prefer the scalar as you originally gave then i’m sure we can define something even more complicated like ‘LLVMPointerToType<LLVMGetScalarType<0>>'<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Pete<o:p></o:p></p>
</div>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
-  Elena<br>
<br>
<br>
-----Original Message-----<br>
From: Philip Reames [</span><a href="mailto:listmail@philipreames.com"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">mailto:listmail@philipreames.com</span></a><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">]<span class="apple-converted-space"> </span><br>
Sent: Sunday, October 26, 2014 17:55<br>
To: Hal Finkel<br>
Cc: Demikhovsky, Elena;<span class="apple-converted-space"> </span></span><a href="mailto:llvmdev@cs.uiuc.edu"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">llvmdev@cs.uiuc.edu</span></a><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
Subject: Re: [LLVMdev] Masked vector intrinsics and name mangling<br>
<br>
<br>
<br style="orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">On Oct 26, 2014, at 8:22 AM, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> wrote:<br>
<br>
----- Original Message -----<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">From: "Elena Demikhovsky" <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>><br>
To: "Hal Finkel" <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>><br>
Cc: <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
Sent: Sunday, October 26, 2014 10:17:49 AM<br>
Subject: RE: [LLVMdev] Masked vector intrinsics and name mangling<br>
<br>
Hal, thank you for your opinion.<br>
I just was confused when I saw so long name "<br>
llvm.masked.load.v16i32.p0i32.v16i32.i32.v16i1" .<br>
If we stay with a short name, we do a step towards instruction form.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
I completely understand, I just don't think it matters all that much, and the logic necessary to handle it will just become a source of bugs (and thus a distraction). You don't need to worry about the exact mangled name when working with the intrinsic at the
 IR level. Let's get the intrinsic in first, we can always shorten the name later in a backward-compatible fashion if we decide it is worthwhile. I think one could make an argument that the mangling is really unnecessary on all of the intrinsics, and maybe
 this is an improvement worth making, but I think we should deal with it as a separate matter.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">I agree with Hal on both points here.  It's worth discussing how to remove mangling for all intrinsics, but that should be a separate discussion.<span class="apple-converted-space"> </span><br>
<br>
+1 for the proposed intrinsics<br>
<br>
Philip<br>
<br style="orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px">
<br>
</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
Thanks again,<br>
Hal<br>
<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
<br>
-  Elena<br>
<br>
<br>
-----Original Message-----<br>
From: Hal Finkel [<a href="mailto:hfinkel@anl.gov">mailto:hfinkel@anl.gov</a>]<br>
Sent: Sunday, October 26, 2014 17:06<br>
To: Demikhovsky, Elena<br>
Cc: <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
Subject: Re: [LLVMdev] Masked vector intrinsics and name mangling<br>
<br>
----- Original Message -----<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">From: "Elena Demikhovsky" <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>><br>
To: <a href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
Sent: Sunday, October 26, 2014 5:34:46 AM<br>
Subject: [LLVMdev] Masked vector intrinsics and name mangling<br>
<br>
<br>
<br>
Hi,<br>
<br>
The proposed masked vector intrinsics are overloaded - one intrinsic<span class="apple-converted-space"> </span><br>
ID for multiple types.<br>
After name mangling it will look like:<br>
<br>
%res = call <16 x i32><br>
@llvm.masked.load.v16i32.p0i32.v16i32.i32.v16i1(i32* %addr, <16 x<br>
i32>%passthru, i32 4, <16 x i1> %mask)<br>
6 types x 3 vector sizes = 18 names for one operation<br>
<br>
I propose to remove name mangling from these intrinsics:<br>
%res = call <16 x i32> @llvm.masked.load (i32* %addr, <16 x<br>
i32>%passthru, i32 4, <16 x i1> %mask)<br>
<br>
def int_masked_load :<br>
Intrinsic<[llvm_anyvector_ty], [llvm_anyptr_ty, llvm_anyvector_ty,<span class="apple-converted-space"> </span><br>
llvm_anyint_ty, llvm_anyvector_ty], [IntrReadArgMem,<span class="apple-converted-space"> </span><br>
NoNameMangling]>; // new property<br>
<br>
It will significantly simplify reading and manual writing.<br>
What do you think?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
We already have this kind of situation for @llvm.memcpy and friends,<span class="apple-converted-space"> </span><br>
and while it can make the IR look verbose at times, we have<span class="apple-converted-space"> </span><br>
reasonable interfaces for creating and manipulating these at the C++<span class="apple-converted-space"> </span><br>
level, so I don't think it is worthwhile to further complicate the<span class="apple-converted-space"> </span><br>
system.<br>
<br>
-Hal<br>
<br>
<br>
<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
Thank you.<br>
<br>
<br>
  * Elena<br>
<br>
<br>
<br>
<br>
<br>
--------------------------------------------------------------------<br>
-<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material<span class="apple-converted-space"> </span><br>
for the sole use of the intended recipient(s). Any review or<span class="apple-converted-space"> </span><br>
distribution by others is strictly prohibited. If you are not the<span class="apple-converted-space"> </span><br>
intended recipient, please contact the sender and delete all copies.<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">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<br>
---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<span class="apple-converted-space"> </span><br>
the sole use of the intended recipient(s). Any review or distribution<span class="apple-converted-space"> </span><br>
by others is strictly prohibited. If you are not the intended<span class="apple-converted-space"> </span><br>
recipient, please contact the sender and delete all copies.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
--<br>
Hal Finkel<br>
Assistant Computational Scientist<br>
Leadership Computing Facility<br>
Argonne National Laboratory<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">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">---------------------------------------------------------------------<br>
Intel Israel (74) Limited<br>
<br>
This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.<br>
<br>
<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
</span><a href="mailto:LLVMdev@cs.uiuc.edu"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">LLVMdev@cs.uiuc.edu</span></a><span class="apple-converted-space"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""> </span></span><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">        </span><a href="http://llvm.cs.uiuc.edu/"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">http://llvm.cs.uiuc.edu</span></a><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif""><br>
</span><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev"><span style="font-size:9.0pt;font-family:"Helvetica","sans-serif"">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</span></a><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p>---------------------------------------------------------------------<br>
Intel Israel (74) Limited</p>

<p>This e-mail and any attachments may contain confidential material for<br>
the sole use of the intended recipient(s). Any review or distribution<br>
by others is strictly prohibited. If you are not the intended<br>
recipient, please contact the sender and delete all copies.</p></body>
</html>