[llvm-bugs] [Bug 30561] New: [AVX512F] Suboptimal code generated for a _mm_mask_move_sd expansion

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Sep 29 06:50:32 PDT 2016


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

            Bug ID: 30561
           Summary: [AVX512F] Suboptimal code generated for a
                    _mm_mask_move_sd expansion
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: zvi.rackover at intel.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

We currently do not support the AVX512F _mm_mask_move_sd
[https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_move_sd]
intrinics, but a reasonable expansion of this intrinsics to LLVM IR may be:

define <2 x double> _mm_mask_move_sd(<4 x float> %__W, i8 zeroext %__U, <2 x
double> %__A, <2 x double> %__B) local_unnamed_addr #2 {
entry:
  %0 = bitcast <4 x float> %__W to <2 x double>
  %and.i = and i8 %__U, 1
  %tobool.i = icmp ne i8 %and.i, 0
  %__B.elt.i = extractelement <2 x double> %__B, i32 0
  %__W.elt.i = extractelement <2 x double> %0, i32 0
  %vecext.i = select i1 %tobool.i, double %__B.elt.i, double %__W.elt.i
  %vecins.i = insertelement <2 x double> %__A, double %vecext.i, i32 0
  ret <2 x double> %vecins.i
}

which should be lowered to:
==========================================
        kmovw     %edi, %k1
        vmovsd    %xmm2, %xmm1, %xmm0{%k1}
        retq
==========================================

'llc -mcpu=knl' generates:
==========================================
        testb   $1, %dil
        jne     .LBB0_2
# BB#1:                                 # %entry
        vmovapd %xmm0, %xmm2
.LBB0_2:                                # %entry
        vmovsd  %xmm2, %xmm1, %xmm0     # xmm0 = xmm2[0],xmm1[1]
        retq
==========================================

-- 
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/20160929/2a55810f/attachment.html>


More information about the llvm-bugs mailing list