[LLVMbugs] [Bug 22206] New: extra moves generated for unary SSE ops

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 12 07:20:18 PST 2015


            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: unassignedbugs at nondot.org
          Reporter: spatel+llvm at rotateright.com
                CC: llvmbugs at cs.uiuc.edu
    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

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150112/1a6752bb/attachment.html>

More information about the llvm-bugs mailing list