Hi LLVMdev,<br><br>In the specification of llvm ir, the select operation can takes a condition of vector type,<br><h4>
<a name="i_select">'<tt>select</tt>' Instruction</a>
</h4>
<h5>Syntax:</h5>
<pre> <result> = select <i>selty</i> <cond>, <ty> <val1>, <ty> <val2> <i>; yields ty</i>
<i>selty</i> is either i1 or {<N x i1>}
</pre>
<h5>Overview:</h5>
<p>The '<tt>select</tt>' instruction is used to choose one value based on a
condition, without branching.</p><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,monospace;"> define void @main() {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">entry:</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> %Cy300 = alloca <4 x float></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %Cy11a = alloca <2 x float></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> %Cy118 = alloca <2 x float></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %Cy119 = alloca <2 x float></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> br label %B1</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">B1: ; preds = %entry</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> %0 = load <2 x float>* %Cy119</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %1 = fptosi <2 x float> %0 to <2 x i32></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> %2 = sitofp <2 x i32> %1 to <2 x float></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %3 = fcmp ogt <2 x float> %0, zeroinitializer</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> %4 = fadd <2 x float> %2, <float 1.000000e+00, float 1.000000e+00></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %5 = select <2 x i1> %3, <2 x float> %4, <2 x float> %2</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> %6 = fcmp oeq <2 x float> %2, %0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %7 = select <2 x i1> %6, <2 x float> %0, <2 x float> %5</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> store <2 x float> %7, <2 x float>* %Cy118</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> %8 = load <2 x float>* %Cy118</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> store <2 x float> %8, <2 x float>* %Cy11a</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> ret void</span><br>}<br><br><br>Thanks,<br>David<br>