[LLVMbugs] [Bug 22788] New: Redundant zeroing of high vector elements for scalar SSE/AVX instructions

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Mar 4 07:38:48 PST 2015


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

            Bug ID: 22788
           Summary: Redundant zeroing of high vector elements for scalar
                    SSE/AVX instructions
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: michael.m.kuperstein at intel.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Using scalar x86 intrinsics results in IR similar to this:

define void @foo(double* %p, double* %q, <2 x double>* %r) {
  %v = load double, double* %p, align 16
  %w = load double, double* %q, align 16
  %mul = fmul double %v, %w
  %vec = insertelement <2 x double> <double undef, double 0.000000e+00>, double
%mul, i32 0
  store <2 x double> %vec, <2 x double>* %r, align 16
  ret void
}

This gets lowered into:
movsd   (%rcx), %xmm0           # xmm0 = mem[0],zero
mulsd   (%rdx), %xmm0
movq    %xmm0, %xmm0            # xmm0 = xmm0[0],zero
movdqa  %xmm0, (%r8)

The movq is redundant - movsd from memory zeroes the high element, and mulsd
preserves it.

-- 
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/20150304/e1c1be64/attachment.html>


More information about the llvm-bugs mailing list