http://llvm.org/bugs/show_bug.cgi?id=22206

            Bug ID: 22206
           Summary: extra moves generated for unary SSE ops
           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

This is SSE (but not AVX) fallout from fixing correctness in bug 14221. This
was originally reported by Michael Kuperstein in http://reviews.llvm.org/D6885.

Using llc built from r225612:

$ cat sqrtss.ll
define float @sqrtss(<4 x float> %a) {
    %res = tail call <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float> %a) nounwind
    %new = extractelement <4 x float> %res, i32 0
    %orig = extractelement <4 x float> %a, i32 0
    %add = fadd float %new, %orig
    ret float %add
}
declare <4 x float> @llvm.x86.sse.sqrt.ss(<4 x float>) nounwind readnone 

$ ./llc sqrtss.ll -o -
..
    movaps    %xmm0, %xmm1   ## copy original value because...
    sqrtss    %xmm1, %xmm1   ## current unary op def requires src == dst
    addss    %xmm0, %xmm1   ## different bug here...
    movaps    %xmm1, %xmm0   ## could have swapped add operands to avoid mov
    retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to