Hi Rotem,<br><br>What do you mean by <span style="font-size: 11pt; color: rgb(31, 73, 125);">"you can use the <4 x float> type for which the vselect works".<br><br><font color="#000000">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. </font><br>
</span><br><div class="gmail_quote">On Wed, Oct 19, 2011 at 4:21 PM, Rotem, Nadav <span dir="ltr"><<a href="mailto:nadav.rotem@intel.com">nadav.rotem@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">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.  <u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"><u></u> <u></u></span></p><div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;">
<p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <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<u></u><u></u></span></p>
</div><div><div></div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal">Hi LLVMdev,<br><br>In the specification of llvm ir, the select operation can takes a condition of vector type,<u></u><u></u></p>
<h4><a name="1331b48fea93aeb1_i_select">'</a><tt><span style="font-size: 10pt;">select</span></tt>' Instruction <u></u><u></u></h4><h5>Syntax:<u></u><u></u></h5><pre>  <result> = select <i>selty</i> <cond>, <ty> <val1>, <ty> <val2>             <i>; yields ty</i><u></u><u></u></pre>
<pre><u></u> <u></u></pre><pre>  <i>selty</i> is either i1 or {<N x i1>}<u></u><u></u></pre><h5>Overview:<u></u><u></u></h5><p>The '<tt><span style="font-size: 10pt;">select</span></tt>' instruction is used to choose one value based on a condition, without branching.<u></u><u></u></p>
<p class="MsoNormal"><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<u></u><u></u></p></div></div></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></div></blockquote></div><br>