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

            Bug ID: 22024
           Summary: Unnecessary vxorps instructions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

Created attachment 13590
  --> http://llvm.org/bugs/attachment.cgi?id=13590&action=edit
Test case

For the following code:

void foo(float *A, float *B, long x, long y) {
        *B = y;
    *A = x;
}

gcc -S -o - /tmp/test.c -O3 -mavx

    vcvtsi2ssq    %rcx, %xmm0, %xmm0
    vmovss    %xmm0, (%rsi)
    vcvtsi2ssq    %rdx, %xmm0, %xmm0
    vmovss    %xmm0, (%rdi)
    ret

clang -S -o - /tmp/test.c -O3 -mavx

    vcvtsi2ssq    %rcx, %xmm0, %xmm0
    vmovss    %xmm0, (%rsi)
    vxorps    %xmm0, %xmm0, %xmm0
    vcvtsi2ssq    %rdx, %xmm0, %xmm0
    vmovss    %xmm0, (%rdi)
    retq

The vxorps instruction is unnecessary.

-- 
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