<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:x="urn:schemas-microsoft-com:office:excel" 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 12 (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;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
h4
        {mso-style-priority:9;
        mso-style-link:"Heading 4 Char";
        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";
        font-weight:bold;}
h5
        {mso-style-priority:9;
        mso-style-link:"Heading 5 Char";
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:10.0pt;
        font-family:"Times New Roman","serif";
        font-weight:bold;}
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
        {mso-style-priority:99;
        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";}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
tt
        {mso-style-priority:99;
        font-family:"Courier New";}
span.Heading4Char
        {mso-style-name:"Heading 4 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 4";
        font-family:"Cambria","serif";
        color:#4F81BD;
        font-weight:bold;
        font-style:italic;}
span.Heading5Char
        {mso-style-name:"Heading 5 Char";
        mso-style-priority:9;
        mso-style-link:"Heading 5";
        font-family:"Cambria","serif";
        color:#243F60;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle23
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
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=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I fixed this bug in r142488. You can give it a try.<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><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Cheers, <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Nadav<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 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"'> Fan Dawei [mailto:fandawei.s@gmail.com] <br><b>Sent:</b> Wednesday, October 19, 2011 11:06<br><b>To:</b> Rotem, Nadav<br><b>Cc:</b> LLVMdev@cs.uiuc.edu<br><b>Subject:</b> Re: [LLVMdev] Error when cond of select instruction is a vector<o:p></o:p></span></p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='margin-bottom:12.0pt'>Hi Rotem,<br><br>What do you mean by <span style='font-size:11.0pt;color:#1F497D'>"you can use the <4 x float> type for which the vselect works".<br><br></span><span style='font-size:11.0pt;color:black'>Do you mean that then back-end can correctly split the operands when it is a four elements vector? I've try that, but it still fails. </span><o:p></o:p></p><div><p class=MsoNormal>On Wed, Oct 19, 2011 at 4:21 PM, Rotem, Nadav <<a href="mailto:nadav.rotem@intel.com">nadav.rotem@intel.com</a>> wrote:<o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'>This is indeed a bug. I get a different error on my machine. Until we solve this bug, as a workaround, you can use the <4 x float> type for which the vselect works.  </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p><div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:-moz-use-text-color -moz-use-text-color'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:10.0pt'>From:</span></b><span style='font-size:10.0pt'> <a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a> [mailto:<a href="mailto:llvmdev-bounces@cs.uiuc.edu" target="_blank">llvmdev-bounces@cs.uiuc.edu</a>] <b>On Behalf Of </b>Fan Dawei<br><b>Sent:</b> Wednesday, October 19, 2011 10:10<br><b>To:</b> <a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a><br><b>Subject:</b> [LLVMdev] Error when cond of select instruction is a vector</span><o:p></o:p></p></div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi LLVMdev,<br><br>In the specification of llvm ir, the select operation can takes a condition of vector type,<o:p></o:p></p><h4><a name="1331b48fea93aeb1_i_select">'</a><tt><span style='font-size:10.0pt'>select</span></tt>' Instruction <o:p></o:p></h4><h5>Syntax:<o:p></o:p></h5><pre>  <result> = select <i>selty</i> <cond>, <ty> <val1>, <ty> <val2>             <i>; yields ty</i><o:p></o:p></pre><pre> <o:p></o:p></pre><pre>  <i>selty</i> is either i1 or {<N x i1>}<o:p></o:p></pre><h5>Overview:<o:p></o:p></h5><p>The '<tt><span style='font-size:10.0pt'>select</span></tt>' instruction is used to choose one value based on a condition, without branching.<o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><br>If the condition is a vector of i1, then the value arguments must be vectors of the same size, and the selection is done element by element. <br><br>However when I create a program use vector of il as the type of condition. The back-end fails and complains:<br><br><i>SplitVectorOperand Op #0: 0x2b75370: f32 = select 0x2b6c800, 0x2b75270, 0x2b75170 [ID=0]<br><br>Do not know how to split this operator's operand!</i><br><br>The following program is a valid IR which passed by the checker. However the back-end fails on all the targets I've tested, including x86, mips and sparc. Is it a target independent bug?<br><br><span style='font-family:"Courier New"'> define void @main() {<br>entry:<br>  %Cy300 = alloca <4 x float><br>  %Cy11a = alloca <2 x float><br>  %Cy118 = alloca <2 x float><br>  %Cy119 = alloca <2 x float><br>  br label %B1<br><br>B1:                                               ; preds = %entry<br>  %0 = load <2 x float>* %Cy119<br>  %1 = fptosi <2 x float> %0 to <2 x i32><br>  %2 = sitofp <2 x i32> %1 to <2 x float><br>  %3 = fcmp ogt <2 x float> %0, zeroinitializer<br>  %4 = fadd <2 x float> %2, <float 1.000000e+00, float 1.000000e+00><br>  %5 = select <2 x i1> %3, <2 x float> %4, <2 x float> %2<br>  %6 = fcmp oeq <2 x float> %2, %0<br>  %7 = select <2 x i1> %6, <2 x float> %0, <2 x float> %5<br>  store <2 x float> %7, <2 x float>* %Cy118<br>  %8 = load <2 x float>* %Cy118<br>  store <2 x float> %8, <2 x float>* %Cy11a<br>  ret void</span><br>}<br><br><br>Thanks,<br>David<o:p></o:p></p></div></div></div><p class=MsoNormal><span style='font-family:"Courier New"'>---------------------------------------------------------------------<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.</span><o:p></o:p></p></div></div><p class=MsoNormal><o:p> </o:p></p></div><font face="monospace">---------------------------------------------------------------------<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.</font></body></html>