[llvm-bugs] [Bug 33692] New: AVX-512: Extractelement is not optimal for i1 vectors

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 5 09:57:19 PDT 2017


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

            Bug ID: 33692
           Summary: AVX-512: Extractelement is not optimal for i1 vectors
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: elena.demikhovsky at intel.com
                CC: llvm-bugs at lists.llvm.org

operation extractelement <16 x i1> %vec, i32 const // Not only 16
can generate more optimal code:

; This code in loop preheader
  %v_mask = icmp slt <16 x i32> %a, %b

; This code inside the loop vector body
  %s_mask = extractelement <16 x i1> %v_mask, i32 5
  br i1 %s_mask, label %pred.if, label %pred.continue

pred.if:                                     
 ..

 pred.continue:

vpcmpgtd        %zmm0, %zmm1, %k0
#The instructions bellow are inside the loop body

kshiftlw        $10, %k0, %k0
kshiftrw        $15, %k0, %k0
kmovd   %k0, %eax
testb   $1, %al
je      .LBB0_2

More optimal code:

 vpcmpgtd        %zmm0, %zmm1, %k0
 vpmovm2b %k0, %xmm2

#The instructions bellow will be inside the loop body

  vpextrb %xmm2, %eax
  testb   $1, %al
  je      .LBB0_2

-- 
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/20170705/1ef8beaf/attachment.html>


More information about the llvm-bugs mailing list