<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [x86, SSE] high elements of vectors are not ignored as expected"
   href="https://llvm.org/bugs/show_bug.cgi?id=24523">24523</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>[x86, SSE] high elements of vectors are not ignored as expected
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: X86
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>spatel+llvm@rotateright.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Noticed in <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - [x86] fmax/fmin calls should be optimized and inlined"
   href="show_bug.cgi?id=24475">bug 24475</a>: we're not eliminating meaningless ops on the higher
elements of vectors.

$ cat isnan.ll 
define float @my_sse_isnan(float %f1) {
  %v1 = insertelement <4 x float> undef, float %f1, i32 0

  ; this shouldn't affect anything; we only care about the low (scalar) element
  %v2 = insertelement <4 x float> %v1, float 0.0, i32 1  

  %cmpss = tail call <4 x float> @llvm.x86.sse.cmp.ss(<4 x float> %v2, <4 x
float> %v2, i8 3)
  %ext = extractelement <4 x float> %cmpss, i32 0
  ret float %ext
}

$ ./llc -o - isnan.ll 
...
  xorps    %xmm1, %xmm1
  movss    %xmm0, %xmm1            ## xmm1 = xmm0[0],xmm1[1,2,3]
  cmpunordss    %xmm1, %xmm1
  movaps    %xmm1, %xmm0
  retq


I was expecting that to be reduced to:

  cmpunordss %xmm0, %xmm0
  retq</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>