https://llvm.org/bugs/show_bug.cgi?id=24523

            Bug ID: 24523
           Summary: [x86, SSE] high elements of vectors are not ignored as
                    expected
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Noticed in bug 24475: 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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to